You are here

Troubleshooting and Resolving PrestaShop CMS Product Addition Bug


Troubleshooting and Resolving PrestaShop CMS Product Addition Bug

Dealing with a perplexing bug in your PrestaShop online store's admin panel? You're not alone. In this blog post, we'll explore a common issue where the "Save" and "Save and Stay" buttons appear stuck in a never-ending loading loop when attempting to add products. We'll dissect the root cause and provide a clear, step-by-step solution to put this annoyance to rest.

The PrestaShop Bug:

This bug exhibits as unresponsive "Save" and "Save and Stay" buttons, making product addition a frustrating ordeal. While it doesn't happen consistently, it plagues users in approximately 70% of cases. Occasionally, refreshing the page offers a temporary reprieve, but this isn't a sustainable workaround.

 

Troubleshooting and Resolving PrestaShop CMS Product Addition Bug

Understanding the Cause:

PrestaShop underwent a significant change in its product addition mechanism during a recent update. Now, when you add a product via Ajax, all the tabs related to product addition load concurrently. If any of these pages encounter an error, the entire loading process grinds to a halt. While the precise reasons behind these intermittent errors remain elusive, various attempts to resolve them—such as disabling modules, altering PHP versions, and tweaking PHP settings—have yielded no success.

An Effective Solution:

Although the solution we're about to present may introduce minor quirks during the product addition process, we've conducted preliminary tests, and it effectively eliminates the "endless loading" issue.

Step-by-Step Fix:

To rectify the problem of endlessly spinning/loading buttons in PrestaShop, follow these straightforward steps:

  1. Locate and open all files with the ".inc" extension found in the directory: admin/themes/default/template/controllers/products.
  2. Inside these files, search for the following lines:
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
  1. Replace these lines with:

 

<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save'}</button>
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save and stay'}</button>

In essence, remove the disabled="disabled" attribute and change class="process-icon-loading" to class="process-icon-save".

By following these steps, you can efficiently resolve the exasperating issue of unresponsive buttons in PrestaShop when adding products via the admin panel. While this solution may introduce minor inconveniences during the product addition process, it effectively eliminates the problem of endless loading, allowing you to manage your online store smoothly.

Now, you can optimize your PrestaShop experience and focus on scaling your e-commerce venture without the hassle of technical glitches.

0 0

Share the article with your friends in social networks, maybe it will be useful to them.


If the article helped you, you can >>thank the author<<