Forum

Thread tagged as: Question, Shop

Address changes

I am using the address management functions.

It would be useful to be able allow the user to unset their address to be changed. (Even allow addresses to be deleted.)

Any tips on this would be appreciated.

Fred Stidston

Fred Stidston 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think that should be possible. What problem are you running into there?

Note, if the customer has placed an order then the address tied to that order is still kept for accounting/tax purposes.

I was looking for something like perch_shop_addresses_unset() and see nothing for it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

There is perch_shop_delete_adddress()

Thanks, not sure if that will be what I need.

On a confirmation page, how can I use perch to let a user go back to the perch_shop_order_address_form() and select addresses again?

Drew McLellan

Drew McLellan 2638 points
Perch Support

On confirmation of what, sorry?

Before the user pays there is a confirmation page showing the addresses they selected.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. So you want to be able to create a link?

Yes I'd like two links. One from the order addresses form to submit through to the confirmation page, and I'd like the confirmation page to link back to the orders addresses form.

The issue now is that the order addresses form submits to the same page. When that's working then I can try to submit the order addresses form a second time to change the order addresses.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure what you need help with.

The original issue is that you can only set addresses once using functions in the documentation.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

how can I use perch to let a user go back to the perch_shop_order_address_form() and select addresses again?

So you have a checkout page and you've set it to allow the customer to select/add their addresses, but you are unsure how you can make it possible for the customer to edit their addresses after they pass this step in your checkout flow?

Yes, because calling set addresses twice does not update the addresses