Question

In my shipping module I'm trying to check the payment type and only return true for valid() if the payment type is not COD. Basically, I only want to give shipping choices of Local Delivery or Local Pickup if paying by COD and not allow actual shipping methods.

My problem is that in the valid() method of the shipping modules I don't know how to access the current order information. Is there a way to have the order information passed in to the init call? Or some other way to look it up?

Was it helpful?

Solution

After some more research I found a signal

shipping.signals.shipping_choices_query

This allowed me to filter the shipping options that are displayed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top