Maria Costa Posted September 16, 2020 Share Posted September 16, 2020 Hello, I need help displaying product stock availability information on the In Stock / Out of Stock label in the product list. Sample in the attached photo. For for Prestashop 1.7.4.4. Thanks 1 Link to comment Share on other sites More sharing options...
Maria Costa Posted September 17, 2020 Author Share Posted September 17, 2020 anyone? Link to comment Share on other sites More sharing options...
Maria Costa Posted September 21, 2020 Author Share Posted September 21, 2020 up Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2020 Share Posted September 21, 2020 (edited) This is not advice for a few minutes. If you do not have programming knowledge of Prestashop, it is difficult for anyone to advise. It would be best to hire someone to modify it. In your case, just look at the addFlags function in the ./src/Core/Product/ProductPresenter.php file. You will create your own condition and create your own CSS style. if ($product['quantity'] > 0) { $flags['in-stock'] = array( 'type' => 'custom-in-stock', 'label' => $this->translator->trans('Custom in stock', array(), 'Shop.Theme.Catalog'), ); } if ($product['quantity'] < 1) { $flags['out-of-stock'] = array( 'type' => 'custom-out-of-stock', 'label' => $this->translator->trans('Custom out of stock', array(), 'Shop.Theme.Catalog'), ); } Edited September 21, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2020 Share Posted September 21, 2020 (edited) Or it can be done more simply by editing the TPL template and creating a css style. E.g. ./themes/classic/templates/catalog/_partials/miniatures/product.tpl product.tpl: CSS: When you upgrade to Prestashop 1.7.6 and higher, there is already a "actionProductFlagsModifier" hook, which can be used in the module and change your own label as you wish. Edited September 21, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2020 Share Posted September 21, 2020 (edited) Prestashop 1.7.6 > Hook in own module: or add a custom message when the product has attributes? .... .... .... And this way I could go on indefinitely. Edited September 21, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Maria Costa Posted September 22, 2020 Author Share Posted September 22, 2020 (edited) 23 horas atrás, Guest disse: Ou pode ser feito de forma mais simples editando o modelo TPL e criando um estilo css. Por exemplo, ./themes/classic/te mplates / catalog / _partials / miniatures / product.tpl product.tpl : CSS: Quando você atualiza para Prestashop 1.7.6 e superior, já existe um gancho "actionProductFlagsModifier", que pode ser usado no módulo e alterar seu próprio rótulo como desejar. Hello, thank you very much for your help, should i paste this code in product.tpl? I apologize for my English Edited September 22, 2020 by Maria Costa (see edit history) Link to comment Share on other sites More sharing options...
Maria Costa Posted September 29, 2020 Author Share Posted September 29, 2020 anyone? Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 4 minutes ago, Maria Costa said: anyone? And what else do you want? I gave you the solution. If you do not understand, visit the forum in your language !!! https://www.prestashop.com/forums/forum/202-fórum-em-português/ No one here will do the work for you !!! There is a JOB thread for that !!!https://www.prestashop.com/forums/forum/235-job-offers/ 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