Forum
Shop Checkout Addresses
I'm having great difficulty working out how to get addresses to work nicely with checkout. I've tried using the nest demo as an example, but even with it I can place an order and no shipping or billing address details are asked for?
A customer simply registers as a member, logs in and places an order and at no stage are they asked for an address!? So an admin would come along and not know where to ship an item!!
The managing address examples seem to have lots of duplicate addresses which is really messy.
Ideally, I think a simple one page checkout with a pre-populated billing/shipping address and shipping method would be very beneficial. Any direction?
That should be possible (it's what I do for my course sales) but we would need to see your code to see what problem you are having as it really is up to you how you set it up.
The best approach is to decide what you want for your store, then look at using the functions to do that. We wanted to avoid making this a "shop in a box" and restricting people to a very few options. However that does mean you need to do the step of designing that process first.
Thanks, think I'm slowly getting closer to something that might work.
Initial orders work fine as the addresses from the registration processes save and
perch_shop_addresses_set
is true. If a user comes back to order again though,perch_shop_addresses_set
is not true andperch_shop_order_address_form
is displayed. Is there a way to programmatically set the addresses? (Billing to 'default' and Shipping to 'shipping')The idea at that point is that you can display the address options and enable the customer to pick an existing address, edit the address or specify a new one.
Understood, the address picker is displaying and works, I would just prefer it not to and to automatically pick the addresses that were used last time. If I could programmatically set the address to the addresses with id's 'default' and 'shipping' that would would be ideal.
Have you verified that that doesn't actually happen? I think it might well.
No, it doesn't. When you try to reorder
perch_shop_addresses_set
is false.Right, but what happens then? I think if you more forward the defaults are used.
If I don't check for
perch_shop_addresses_set
and try to move forward and place the order,perch_shop_order_successful
is false on the results page. The only difference I can see in the CMS backend is there is no BILL_ADDRESS or SHIP_ADDRESS in the Tax Evidence tab for the order.I tried another approach using
perch_shop_customer_edit_form
instead ofperch_shop_order_address_form
which is pre-populated and allows the customer to change address details but when update is hitperch_shop_addresses_set
is still false!And when
perch_shop_addresses_set
is false,perch_shop_order_addresses
displays nothing and I need it to display the addresses for the customer to confirm and place their order.Ok. I'm not sure I understand what's going on. Does the customer have an address, even if it's not been set?
Ok, I'll see if I can define what's happening and what I'd like...
When a new customer goes through the cart and gets to the checkout, they get to the following code:
perch_shop_addresses_set
is true as they've just filled in the new customer register form andperch_shop_order_addresses
displays the addresses with edit buttons for the customer to see before clicking "Pay". This all works great!The issue is returning customers. When they log in or are already logged in and try to place another order, when they get through to the same part of checkout,
perch_shop_addresses_set
is false andperch_shop_order_address_form
displays 2 lists of addresses.I don't want to display these ugly lists. I either want to programmatically set
perch_shop_addresses_set
true (using the defaults) soperch_shop_order_addresses
displays or displayperch_shop_customer_edit_form
and when this form is submitted haveperch_shop_addresses_set
set to true (which it does not).It seems the only way to get
perch_shop_addresses_set
true is to submit theperch_shop_order_address_form
?