Jump to content

500 Error on changing variants


Vee.K727

Recommended Posts

Hi. This part has been working fine until now and nothing has changed that would be relevant for this error to appear. I'm using PS 1.7.6.5 and I have products with combinations. In the screenshots, you can see I have 3 combinations in this product.

775378912_2020-08-06(1).thumb.jpg.1cdf579faf03f9d51779b040d8ba1cca.jpg

In the front end though, only 2 appear and clicking on it brings up the red error box saying "An error occurred while processing your request" and doesn't switch variants.

2036063638_2020-08-06(2).thumb.jpg.b6719dad5eaa78c40e79ebedb8953bf4.jpg

In the network tab, I see an ajax request is sent on clicking a variant but the response is a 500 server error showing an error in Mysql statement.

2020-08-06.thumb.jpg.34d65092b223e3a366bc9c91c4f36b51.jpg

Can someone help me with this?

Edit: The third combi was not appearing because of an image issue. I've resolved that. But the error on changing it remains.

Edited by Vee.K727
Added more info (see edit history)
Link to comment
Share on other sites

Dude I'm not even sure where to begin looking. Can you be a bit more specific? This is not "my" javascript, this is all core prestashop features which is very hard to understand.

Can you tell me whats supposed to be in the brackets and where does it come from?

Link to comment
Share on other sites

Sorry, I can't.

If you are capable of seeing the result of an ajax operation you should also be capable of seeing what is sent to that operation. It is almost the same tab.

In your first picture I see "0 of 3 selected". That could be the cause of the error. It is up to your creativity to find out.

Link to comment
Share on other sites

  • 2 months later...

Hi all,

Hope you will be able to help me finding (and fixing) a bug that seems to be the same as described above.

I have a shop (version 1.7.6.5, PHP 7.2, default/classic prestashop template) and everything works fine.... except product variants. When a user opens a product page to select different color of that product, the page displays a message "An error occurred while processing your request" under the "Add to cart" button.

The inspect console tells that the server returns "500 Sever Error", saying "Oops, something went wrong."

Log on the server says

"POST /index.php?controller=product&token=7c5103bec05826f1beae2462fd282f67&id_product=102&id_customization=0&group%5B2%5D=8&qty=1 HTTP/2" 500

Does anybody know what can be the reason and how to fix this?

I'm not sure where to look for a reason and I'm not too skilled to debug and analyze the source code. I can implement a fix in code if somebody will tell where to fix and what.

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...