How to calculate FlatRate Shipping based on Shipping City field?
-
Hi,
How to calculate FlatRate Shipping based on Shipping City field?
my requirement is simple, for a one City say 'Dhaka' is 60 BDT and rest of others 130 BDT ..
How to achieve this
I am looking into this code ..
If I can get City filed value know which source file to change , I think it can implement easily.
https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Shipping/src/Carriers/FlatRate.php#L28Thanks.
-
in that file on line #34, there's a $cart variable..
you can use like $cart->shipping_address->city ...or whatever the address field available..you can comment(disable) the script of the current calculation..or you can overwrite the calculation by inserting something like this before the "return $object" ...
if($cart->shipping_address->city == "Dhaka" { $object->price = 60; $object->base_price = 60; }else{ $object->price = 130; $object->base_price = 130; }
-
Thank you very much, i have implemented that.