Sergio Pernas Posted May 20, 2020 Share Posted May 20, 2020 (edited) Hi! I'm customizing a shop (just some theming, nothing really strange) but our client has one particular demand: he wants the billing and delivery address of orders to be in the same country. I really don't know how to tackle this. Any ideas? Thanks a lot! PS 1.7.6 Edited May 20, 2020 by Sergio Pernas (see edit history) Link to comment Share on other sites More sharing options...
jetway Posted May 21, 2020 Share Posted May 21, 2020 (edited) Hi, well since this is not Prestashop core, behavior you will have to modify the script in an override or check the market if a module is available that locks other countries after the billing address is entered. Edited May 21, 2020 by jetway (see edit history) Link to comment Share on other sites More sharing options...
Sergio Pernas Posted May 22, 2020 Author Share Posted May 22, 2020 Yes, I suppose I'll have to override the CheckoutAdressesStep class, isn't it? I mean, it can't be controlled in address creation, because prestashop can't tell apart the delivery vs the billing addresses. The problem I have is that I'm having a lot of problems with debugging. Inside the if (isset($requestParams['confirm-addresses'])) condition, I try to access, for example to the country id for this address, through $paisFactura = Address::getCountryAndState($id_address); $paisFactura = Address::getCountryAndState($id_address); but I don't know how to access the contents of that $paisFactura variable. I've been looking into some var dumping or at least logging into the console, to no avail. Any help or resources on how to do this? Thanks a lot, Sergio Link to comment Share on other sites More sharing options...
Sergio Pernas Posted May 22, 2020 Author Share Posted May 22, 2020 32 minutes ago, ndiaga said: Hi, This should not be a big issue, you need just to call the customer's id_country in both sections. Sorry, I don't understand what you are saying here. If a customer has 4 addresses, 2 in 2 different countries, how would you check on that? I think that I have to check it on confirm-address, as it's the point where you tell the form which addresses are in use. The problem I have is that I can't debug on that, I can't console log the values from the class. Am I being clear? (sorry, English is not my first language) 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