Jump to content

Forcing delivery and billing address to be in same country


Sergio Pernas

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...