magespecialist / m2-MSP_CashOnDelivery

Cash on delivery module for Magento 2
52 stars 53 forks source link

Add region based fee customization #30

Closed shanavas786 closed 7 years ago

phoenix128 commented 7 years ago

Thank you for your contribution, we just merged it.

phoenix128 commented 7 years ago

@shanavas786 , just FYI there was an error we fixed in 1.2.1:

$region = $quote->getShippingAddress()->getRegion()

Only works for a free input text. If you have a region database you have to use getRegionModel().

$region = $quote->getShippingAddress()->getRegionModel()->getData('code');

if (!$region && is_string($quote->getShippingAddress()->getRegion())) {
    $region = $quote->getShippingAddress()->getRegion();
}
shanavas786 commented 7 years ago

@phoenix128 Thanks, I am pretty new to Magento World, :)