mirkodescalchi Posted May 7, 2022 Share Posted May 7, 2022 Hello people, a very small question to the most experienced: Usage lends the latest version 1.7.8.5 updated and in the product list of the catalog, if an article has 0 as a quantity, it is not colored red (photo 1). This happens instead in the Product list function in the creation of a new article (photo 2). I'm literally going crazy looking for a setting / modification to solve because a red color would allow me an immediate vision of the unavailable products. Any indication? Thank you for your time. Link to comment Share on other sites More sharing options...
Mian Waqas Posted May 10, 2022 Share Posted May 10, 2022 (edited) Hello, Please follow this> Edit: public_html/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig file on line 64 find {% if 'PS_STOCK_MANAGEMENT'|configuration %} and add this code after/below After {% if 'PS_STOCK_MANAGEMENT'|configuration %} Replace the code to this (please look at the screenshot where it should be) {% if product.sav_quantity == 0 %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3" style="background:red; padding: 5px 5px;"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% else %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% endif %} {% else %} <td></td> {% endif %} save it, clear cache and then check the results! (you can play with it along if you need deffirent areas in red) Please hit the like button if you find this helpful Regards Edited May 13, 2022 by Mian Waqas Code edit (see edit history) 1 Link to comment Share on other sites More sharing options...
mirkodescalchi Posted May 11, 2022 Author Share Posted May 11, 2022 HI SMT, You have been amazing and thank you so much for your interest in my question. I changed the code as you indicated and the quantity now has a red background box (not the number). This change, however, added a column causing a misalignment. I think it is easier to color the quantity = 0 on Red. Do you think it is possible? Thanks again. Link to comment Share on other sites More sharing options...
Mian Waqas Posted May 12, 2022 Share Posted May 12, 2022 (edited) Hi, Yes new code, After {% if 'PS_STOCK_MANAGEMENT'|configuration %} Replace the code to this (please look at the screenshot where it should be) {% if product.sav_quantity == 0 %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3" style="background:red; padding: 5px 5px;"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% else %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% endif %} {% else %} <td></td> {% endif %} It should be like this Edited May 13, 2022 by Mian Waqas Code change (see edit history) 1 Link to comment Share on other sites More sharing options...
mirkodescalchi Posted May 12, 2022 Author Share Posted May 12, 2022 (edited) U are TB (you are the best!) It works fine! Just a small problem... showing all products with quantity 0 under "Select All". Can you fix it? Thanks 1000000000000 Edited May 12, 2022 by mirkodescalchi (see edit history) Link to comment Share on other sites More sharing options...
Mian Waqas Posted May 13, 2022 Share Posted May 13, 2022 (edited) My Apologiez, i have edited the code, please check my last comment which i have replaced and re copy it. (i have also changed the screenshot so that you can see). Regards Edited May 13, 2022 by Mian Waqas (see edit history) 1 Link to comment Share on other sites More sharing options...
mirkodescalchi Posted May 13, 2022 Author Share Posted May 13, 2022 YEAH! Now it's perfect! Problem solved! Tks so much U are the best! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now