Prestashop Checkout not working after update 1.7.x.x

PrestaShop checkout stops working after updating. I had updated PrestaShop and the cart stopped working. Customers could start the account creation, but once they click to save address, the page refreshes, and it does not load the payment page.

This is because when updating, the following row was not added in the database.

Follow the steps to fix the issue.

  1. Find out the name of your database
  2. Gain access to either SSH or PHPMYADMIN to edit your DB
  3. Run the query below and replace PREFIX_hook with the DBNAME_hook – so in my case I had named my DB prstadb so the query looked like INSERT INTO prstadb_hook – its essentially the hook column in the database.

INSERT INTO PREFIX_hook (id_hook, name, title, description, active, position) VALUES (NULL, ‘actionValidateCustomerAddressForm’, ‘Customer address form validation’, ‘This hook is called when a customer submits its address form’, ‘1’, ‘1’);

If the solution did not help.

Essentially each country has a set of fields which are required, I believe there was a bug for certain countries after an update, that it changed the format in the database. Inside your database find the tables XXX_address and XXX_address_format

Inside find the XXX_address you can find the country ID which is giving you issues. I had created myself as a user and saved as country Spain, which saved with ID 6 as show below.

prestashop address database table
Table XXX_address

Back to the other table “XXX_address_format” I found country with ID number 6, which would be Spain, and clicked edit.

prestashop country database
Table XXX_address_format

When I checked the fields and compared to a working country, I saw the information inside was different –

Correct Format (Country: UK)Incorrect Format (Country: Spain)Corrected Format (Country: Spain)
firstname lastname
company
vat_number
address1
address2
city
postcode
Country:name
phone
phone_mobile
firstname lastname
company
vat_number
address1
address2
postcode city
Country:name
phone
firstname lastname
company
vat_number
address1
address2
city
postcode
Country:name
phone
phone_mobile
dni

I have highlighted the differences above, below phone in Spain there was an empty space instead of having phone_mobile field. The postcode and city fields were in one line instead of separate lines.

address format prestashop database
Address format in Prestashop DB

So I copied the correct version into the field and saved. Make sure to check that your back-office Country settings are the same as the changes you have made into the database. You will find this at International > Locations > Countries > SELECT THE COUNTRY.

For me, this solved the problem.

If any of the 2 solutions helped you, please help us by following one of our social media or by sharing this page with others. I would greatly appreciate the support.

* indicates required
Idioma / Language

Intuit Mailchimp

Kunal Sajnani
Kunal Sajnanihttps://canariasagusto.com/sobre
Hi! I am Kunal, the author of this blog. I am a computer nerd by training, and a self-taught photographer, web designer, and cook. Don't let the day come when you regret not having explored or tried new things. With that motto, I blog as I discover. Follow me on the adventure!

May interest you

* indicates required
Idioma / Language

Intuit Mailchimp

Related articles

LEAVE A REPLY

Por favor introduzca su comentario.
Introduzca su nombre aqui

This site uses Akismet to reduce spam. Learn how your comment data is processed.