Forum
Shop Addresses Add Edit and Delete
Hi
I am trying to allow members to add a new addresses for say different branches (This is a trade only shop) and want them to be able to set a title e.g. Bristol Branch.
I am using an id of title which works and changes in my address list if i use the standard edit form from perch_shop_customer_addresses(); but this is only good for editing later.
I want to take them to an add address page using perch_shop_form('addresses/add.html');.
but what it seems to do by default is use the first line of address as the id title and id addressTitle.
I think it may be to do with this
<perch:input type="submit" value="Update" class="btn btn-primary" />
<perch:input type="hidden" id="addressID" />
<perch:input type="hidden" id="r" value="/shop/addresses" />
but I'm unsure what to put instead. This is off the standard edit form and I am using it in my add address form. Also I would like an option to delete an address.
You could be conflicting with our internal address titles. Can you use a different ID for your title?
Yep, just checked and that works ) Something else I couldn't figure out was why/how when a customer who already has a member account but is only going through the checkout for the first time has no addresses listed but on return has two listed. One with the default title and one with the shipping title.
These addresses are taken from the member account so will be added to the first order which is ok but it would be better if they were there to edit or chose from beforehand.
I believe it's because I'm attempting to work things backwards slightly due to already having signed up customers as opposed to new shop customers. So is there a way of triggering this behaviour maybe with a shop setup option of sorts so they will appear when the customer goes through checkout for the first time?
Unless I'm missing something, that's completely within your control. You can present the user with the option to add an address at almost any point.
Ok, Is there a way to access the member address that the client has already signed up with to fill out the shop address billing form automatically?
Was that not your complaint, that that was happening and you didn't want it?
Not quite. Sorry if I'm not explaining well, it's tricky. There are 3 issues in this thread - Address Titles, Members v Shop Addresses and Delete Address Option.
The first time through the cart it doesn't show the address the member registered with. It seems to need to go through once for these to be automatically created. So case scenario -
Customer adds their main (sign up) address for the first delivery and names it Main.
The next time they go in there are now 3 addresses the same. One with a title of Main, one with a title of Default and with a title of Shipping. They now have 3 of the same address to choose from but can't delete any of these. Clutter and confusion is the main issue here.
But if I put in the standard form to add shipping and billing addresses for the first time though the checkout. They will have to enter both manually even though the address is already on the system, but in the members db not the shop. I just want to make it more streamlined for the customer.
I hope that explains it better )
Which version of Shop are you using?
I updated this morning.
I've been trying out different solutions and I have an issue with my add address template. Fixing this may help with one solution. I'm using the same form as the edit address one but it doesn't quite act the same.
The first thing is the country select box. It just has a tick in it.
The second is the addressTitle id. I changed it like you suggested but it doesn't talk to the order address form. So my title gets ignored. Using the id of title works but only from the edit form. The add form doesn't work the same.
Could you suggest some changes.
Add-address.html
I am calling it with..
Where as the edit address is called with...
Just an aside if I take them to shop/address/some-random-number. It show the edit form and works well for creating new addresses. ?
I've just realised I can just use <?php perch_shop_edit_address_form(); ?> to add addresses as well as edit them so this kind of solves my problem. Also maybe I'm being overly picky about the titles as first line will always be different and will allow them to differentiate between them. It still would be good to be able to let customers delete additional addresses though if this is possible.
I've totally solved the issues I was having by taking it all apart and starting again.
When I initially set up my member registration form I didn't get my default tag to work first time ( The default tag or type="default" makes it so customers will have to wait to be accepted - status pending). Because of this I submitted the form again before realising I should have edited the form by clicking on the link and saving it.
I now had two forms listed which was giving me two addresses the same but stopping them from showing up on first pass through the checkout, probably due to the conflict.
Anyway, I can now use my original register form, my add address form and edit form as you planned for us.
Thank you for your time, I can see now why you were confused with my issue.
It's not getting addresses again for new sign ups for whatever reason. Maybe I thought I'd fixed it but didn't delete an entry from the database. Any way here is my debug.
This is what happens first time through the checkout. I want it to display an address as the member is already logged in.
I also have this
[18-Aug-2016 10:35:50 Europe/Berlin] PHP Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/bin/mamp/feed/fetchFeed.php on line 20 [18-Aug-2016 10:35:50 Europe/Berlin] PHP Warning: file_get_contents(https://www.mamp.info/feed/mac/MAMP/English/feed/home.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/bin/mamp/feed/fetchFeed.php on line 20
What is
feed/fetchFeed.php
? I don't think that's anything to do with Perch.