Jump to content

Product quantities AJAX update does not work


Recommended Posts

Hi, I am using Prestashop 1.5.5.0 and I have encountered this fatal problem - when changing some product combination quantities, it mostly fails. It shows "Loading" and "Saving data ..." messages, but they are there forever and no changes are made.

 

I found this related issue, but I am not using mentioned module, so there is another problem.

 

Well ... when I change some quantity, my Chrome console screams "Uncaught HierarchyRequestError: A Node was inserted somewhere it doesn't belong."

 

It is connected to ...

<div class="error" id="available_quantity_ajax_error_msg" style="display: none;"></div>

... DIV and showAjaxError() function in admin-products.js file. DIV itself is removed from DOM, because ...

$('#available_quantity_ajax_error_msg').html(msg);

... fails. "msg" is not string, but some JS function. "msg" content is:

function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this}

Well,... it is returned by AJAX call of "ajax-tab.php" file ... and jQuery is expecting regular JSON response. When the response is not valid JSON, it passes some JS function as seen above.

 

So ... there is obviously problem with ajax-tab.php response. For example, this URL admin/ajax-tab.php?actionQty=set_qty&id_product_attribute=2&value=55&ajaxProductQuantity=1&id_product=8&token=b6b6f15a9547c274e9eeb14838837331&ajax=1&controller=AdminProducts&action=productQuantity

 

... does not return JSON response, but regular HTML page with "Invalid secure token" informations! I can click "I undestand the risk ..." and than the quantity change makes it to the database. 

 

I undestand it that AJAX quantity change call is done with already invalid security token. Sometimes. In one of ten cases it works for a while (with page reloading etc.).

 

Well, I am done here. This is prestashop core business ...

Link to comment
Share on other sites

Hi! Well, I don't think it can help - it's "live" site and I can't give anyone back-office access. It is www.fcczech.cz, anyway.

 

It was clean prestashop 1.5.5. instalation with PopShop theme and standard modules ... I only added some modules for "national" delivery and payment support. Everything else works.

 

Is there any issue that can cause security token invalidation when doing AJAX stock quantity change?  And the weird thing -  it is a random behaviour, one times is everything "green", second times it fails.

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