Closed keyurshah closed 4 years ago
I'm trying to add a custom shipping method through a custom provider.
I need to set some of the options with $0 rates (free, pickup in store, etc..), but when I do so, it does not allow me to add it.
It seems the issue is this line
https://github.com/verbb/postie/blob/49f48d61c9b861ad111f87402a1f6d2868f6d888/src/models/ShippingMethod.php#L61-L64
it seems the check (bool)$this->rate will remove anything with 0 or 0.0 amount
(bool)$this->rate
it seems to work if I change it to
return (bool)$this->enabled && isset($this->rate)
I can create a pull request if this would not cause issues to anything else. Thanks!
Yeah, not sure what I was thinking here. Fixed in 2.1.0.
Description
I'm trying to add a custom shipping method through a custom provider.
I need to set some of the options with $0 rates (free, pickup in store, etc..), but when I do so, it does not allow me to add it.
It seems the issue is this line
https://github.com/verbb/postie/blob/49f48d61c9b861ad111f87402a1f6d2868f6d888/src/models/ShippingMethod.php#L61-L64
it seems the check
(bool)$this->rate
will remove anything with 0 or 0.0 amountit seems to work if I change it to
I can create a pull request if this would not cause issues to anything else. Thanks!
Steps to reproduce