FalleN25 Posted June 13, 2010 Share Posted June 13, 2010 Hello,I would like to change something in the CMS: when we are in the process of ordering a product (in the address stape), I want the "Edit" button located below the block "Address Billing" is displayed only when the customer select two different addresses for billing and delivery.Thus, by default, i want that only the "Edit" button situated below the block "Delivery Address" displayed. However, if the customer untick "Use the same address for billing purposes" and select another address, I want the "Edit" button located below the block "Billing Address" is displayed at this time.I've hacked together for almost five hours files "address.js (themes / js)" and "order-file.tpl "making something with the "display: none" but nothing conclusive yet ..Basically, to help you, if idAddress_delivery is != of idAddress_invoice, we display the button "Modify" , otherwise you mask it.Thank you in advance Link to comment Share on other sites More sharing options...
FalleN25 Posted June 13, 2010 Author Share Posted June 13, 2010 Up =) Link to comment Share on other sites More sharing options...
rocky Posted June 14, 2010 Share Posted June 14, 2010 Try changing line 67 (in PrestaShop v1.3) of order-address.tpl in your theme's directory from: {l s='Update'} to: {if $cart->id_address_delivery != $cart->id_address_invoice}{l s='Update'}{/if} Link to comment Share on other sites More sharing options...
FalleN25 Posted June 14, 2010 Author Share Posted June 14, 2010 Thanks for trying helping me.But that doesn't run , I think that the modifications are to be in the ajax file (address.js (themes / js)) because when we tick "Use the same address for billing purposes" and that we chose 2 different adresses, everything is dynamic. Link to comment Share on other sites More sharing options...
rocky Posted June 14, 2010 Share Posted June 14, 2010 You're right. It looks like need to add the following code to the updateAddresses() function in order-address.js after the var definitions: if (idAddress_delivery == idAddress_invoice) $('ul#address_invoice li.address_update').hide(); else $('ul#address_invoice li.address_update').show(); Link to comment Share on other sites More sharing options...
FalleN25 Posted June 15, 2010 Author Share Posted June 15, 2010 Nice ! It's running very well.However, there is a problem.. when we chose 2 different address and that we go in the next page (carrier) and after that we want go back on the address page, the ajax file is ignored, consequently the "modifiy button" is still displayed even if we have chosen 2 different address.I think that the solution to solve the problem is to execute the ajax file (order-address.js) immediatly when we are on the addres page, so that it knows that if we have chosen 2 different addresses, it display the address button immediatly, if not, it maskNevertheless, I don't know how doing it.. ^^Bye Link to comment Share on other sites More sharing options...
FalleN25 Posted June 16, 2010 Author Share Posted June 16, 2010 Can someone help me concerning my problem please ? Link to comment Share on other sites More sharing options...
FalleN25 Posted June 17, 2010 Author Share Posted June 17, 2010 No answer ? Link to comment Share on other sites More sharing options...
rocky Posted June 17, 2010 Share Posted June 17, 2010 It seems no-one else but me wants to help you. I'd like to answer, but I'm busy at the moment. I'll try to answer when I can. Link to comment Share on other sites More sharing options...
FalleN25 Posted June 17, 2010 Author Share Posted June 17, 2010 Thank you very much for your patience.I'm looking forward to see your answer. Link to comment Share on other sites More sharing options...
rocky Posted June 17, 2010 Share Posted June 17, 2010 I've had another look at this issue. I thought I could get it to work by adding class="hidden" or style="display:none" in order-address.tpl, but it didn't work. It looks like it is not possible to do what you want to do. Link to comment Share on other sites More sharing options...
FalleN25 Posted June 18, 2010 Author Share Posted June 18, 2010 Hello !My problem is solved !Here the solution :To hide the address button under the invoice address when the customer have chosen both same address for invoice and delivery, you have to add in order-address.js in the function updateAdresses() after the var definitions: if (idAddress_delivery == idAddress_invoice) $('li#address_invoice li.address_update').hide(); else $('li#address_invoice li.address_update').show(); After that, you have to make the ajax file (order-address.js) running immediatly when you have on the address page by adding that code in header.tpl <body{if $page_name == "order" && $address_step}> Then, add in order.php in displayAddress() $smarty->assign('address_step', true); Thank you very much Rocky Link to comment Share on other sites More sharing options...
rocky Posted June 18, 2010 Share Posted June 18, 2010 I'm glad you figured it out. I tried doing a similar thing, but it caused the Update button to be displayed initially, then disappear, which I thought looked weird.By the way, you don't need to modify order.php to do this, you can just use the following code: <body{if $page_name == "order" && $smarty.get.step|intval == 1}> That way, you only need to modify theme files, which lets you leave order.php unmodified. Link to comment Share on other sites More sharing options...
gerritsen142 Posted October 4, 2010 Share Posted October 4, 2010 Hi guys,the above is great, but i can't figure out the following problem:- I would like to hide the adress1 button from the 'overview page' where you present all customer info before payment.is it possible to set the 'address_delivery select' dropdown on 'hide'? If yes, would you be so kind to elaborate a bit on this?- I would like to not only present the name and address to the customer, but also the emailadress. Is there a solution for this as well?Thanks a million! Link to comment Share on other sites More sharing options...
ukbaz Posted August 6, 2020 Share Posted August 6, 2020 This does not work in Prestashop 1.6 - is there a fix for 1.6 to do this? Thanks Link to comment Share on other sites More sharing options...
ukbaz Posted August 7, 2020 Share Posted August 7, 2020 I have been trying to do what you posted here in v1.6.1.24 Prestashop for a good while with no success! In the post linked to below you explained how to prevent the edit address buttons showing against addresses at checkout when there the invoice and delivery address were the same. Like you explained there I only want the edit buttons when there are different invoice and delivery addresses - it's confusing when there is only one address! Post was here: Unfortunately it's not working in 1.6- I wonder if you could point out what should work here? I did try a bit of javasript to force refresh the whole page, which does hide the buttons when only one address, but also the add billing address button disappears when page fully refreshed doing it that way Thanks Baz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now