We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Shop

Perch Shop Addresses

Hey,

Is it possible to get the set shipping/billing addresses in the cart to display to the user?

Thanks!

Ryan Gittings

Ryan Gittings 1 points

  • 2 years ago

link: https://docs.grabaperch.com/addons/shop/examples/managing-addresses/

To show a customer a list of their addresses:

<?php
  perch_shop_customer_addresses();
?>
Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Hey Robert,

I’ve used that to show what addresses they’ve added, but I can’t find our which exact ones they’ve set for billing and shipping during checkout and display them as a summary of their order before confirming.

Cheers

also see: https://docs.grabaperch.com/functions/shop/customers/perch-shop-customer-address/

perch_shop_customer_address

Display an address for the logged in customer with perch_shop_customer_address()

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Yeah could use the guy but how do I get the ID of the set billing and shipping addresses?

I am only guessing and throwing my idea out here but somehow you might have to use some sort of 'skip-template' option and get this from the returned array.

I have very little shop experience so this is a guess more then answer...

Duncan Revell

Duncan Revell 78 points
Registered Developer

perch_shop_order_addresses() shows the addresses that have been chosen for the order.

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Duncan Revell said:

perch_shop_order_addresses() shows the addresses that have been chosen for the order.

What if the order hasn’t happnened yet? As mentioned I want to show a summary before final order!

Cheers :)

Duncan Revell

Duncan Revell 78 points
Registered Developer

Have you tried it? If addresses have been selected, it will show them - even if the order hasn't happened yet.

Example here:

https://docs.grabaperch.com/addons/shop/examples/order-confirmation/

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Will try now, thanks Duncan!