Jump to content

Shipping / CarrierModule updating Shipping Address?


SirQ

Recommended Posts

I'm currently looking at creating a new CarrierModule. However, I'm not sure if what I want to do is even possible with Prestashop.

 

Right now the checkout flow is:

 

Choose Shipping & Billing Address -> Choose Carrier -> Pay

 

I'd like to give the user an option to select a drop off point when he selects my extra carrier (through a popup using google maps displaying all available drop off points, gas stations etc...)

 

However, when he selects his preferred drop off point, the shipping address should change to this drop off point.

 

But I'm already past the shipping address step in the order wizard.

 

Is there a way to update the shipping address from within a module? (Database updates, calling a webservice, storing a cookie, posting a form back, ... anything)

Link to comment
Share on other sites

You can call the shipping address class using the selected shipping address for the cart $ship_address = new Address($cart->id_address_shipping) (double check, this is off the top of my head), update the fields you wans and then call $ship_address->update();

 

That should do the trick.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...