NOLOGIN Posted May 29, 2017 Share Posted May 29, 2017 (edited) Hey there, I want to perform a really basic and simple task, in fact I want the "On sale" ribbon to show up on ALL products, I have more than 800 products, I don't want to set this option by opening each product one by one. There's certainly a quicker way to accomplish this basic task? Thanks for your help! NL. Edited May 29, 2017 by NOLOGIN (see edit history) Link to comment Share on other sites More sharing options...
NOLOGIN Posted May 29, 2017 Author Share Posted May 29, 2017 Or if someone knows what happens exactly on the database when I set "on sale" from back-office, I could solve this with a global UPDATE SQL query.Thanks. Link to comment Share on other sites More sharing options...
NOLOGIN Posted May 29, 2017 Author Share Posted May 29, 2017 SOLUTION: On phpMyAdmin, type this on a SQL console after selecting your Prestashop database: UPDATE ps_product, ps_product_shop SET ps_product.on_sale=1, ps_product_shop.on_sale=1 Link to comment Share on other sites More sharing options...
Bolonia Posted May 30, 2017 Share Posted May 30, 2017 SOLUTION: On phpMyAdmin, type this on a SQL console after selecting your Prestashop database: UPDATE ps_product, ps_product_shop SET ps_product.on_sale=1, ps_product_shop.on_sale=1 Hi NOLOGIC , i m noob in ps . U know if i modify the database show an image like ribon in certain combination ? Thanks Jon Link to comment Share on other sites More sharing options...
NOLOGIN Posted May 30, 2017 Author Share Posted May 30, 2017 (edited) Hey there @Belonia, Can you access your database via phpMyAdmin? Just to make sure we're on the same line: you can't access the database via Prestashop, you can gain access to it from the cPanel of your hoster. When you accessed phpMyAdmin, follow these steps: Good luck! Edited May 30, 2017 by NOLOGIN (see edit history) Link to comment Share on other sites More sharing options...
DataKick Posted May 30, 2017 Share Posted May 30, 2017 (edited) Or, if you are not friend of SQL, you could also try mass update feature of free datakick module, as shown on this video Edited May 30, 2017 by DataKick (see edit history) Link to comment Share on other sites More sharing options...
NOLOGIN Posted May 30, 2017 Author Share Posted May 30, 2017 @DataKick: seems really interesting! Link to comment Share on other sites More sharing options...
NOLOGIN Posted May 30, 2017 Author Share Posted May 30, 2017 (edited) Important update: this might not work correctly with the products marked as "New" that show up on your index page, to correct this, I suggest the following modification: (works like a charm for me) Edit the following file: root/themes/your_theme/product-list.tpl Find this line: {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} And replace it by this: {if isset($product.on_sale) && $product.on_sale && $product.on_sale == 1 && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} Basically it will force to look at the "On sale" state to enable the "On sale" ribbon. Also, there seems to be problems with cache, I disabled mine, that's the only solution I've got here since Prestashop is a lot more faster without the cache function for me (even though I've got 1500 products). If someone got better solution, go ahead. NL. Edited June 2, 2017 by NOLOGIN (see edit history) Link to comment Share on other sites More sharing options...
Bolonia Posted June 2, 2017 Share Posted June 2, 2017 Important update: this might not work correctly with the products marked as "New" that show up on your index page, to correct this, I suggest the following modification: (works like a charm for me) Edit the following file: root/themes/your_theme/product-list.tpl Find this line: {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} And replace it by this: {if isset($product.on_sale) && $product.on_sale && $product.on_sale == 1 && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} Basically it will force to look at the "On sale" state to enable the "On sale" ribbon. NL. Hi NOLOGIC , i ask u if u know the way to put a new imagen ribbon is some combination only. Example: I have reed blue an yelow and i like whensome user chosse the yellow combination show product ( image) + the ribbon (png file). And this in all the entire site! Sry my english isnt very good Thanks! Jon Link to comment Share on other sites More sharing options...
NOLOGIN Posted June 2, 2017 Author Share Posted June 2, 2017 (edited) Hey Bolonia, I feel like you need some special customization on the code side, or maybe a module does already that? Or what if you put the ribbon on the product's image it self? I guess you have different product images for different combinations, so why not putting the ribbon directly on the picture that is associated to the desired combination? I can't help you more, sorry :/ Good luck. NL. Edited June 2, 2017 by NOLOGIN (see edit history) Link to comment Share on other sites More sharing options...
Bolonia Posted June 2, 2017 Share Posted June 2, 2017 i had 400 products , i think is better to modify some code and not play whit 400 images.Thans alot Link to comment Share on other sites More sharing options...
CyberPepe Posted June 19, 2020 Share Posted June 19, 2020 Hello, We have done something like this but we needed to update only some products with specific category, so we have done this (at phpMyAdmin with PS 1.6.0.5): UPDATE ps_product p INNER JOIN ps_category_product cp ON cp.id_product = p.id_product SET p.on_sale=1 WHERE cp.id_category = 8; UPDATE ps_product_shop ps INNER JOIN ps_category_product cp ON cp.id_product = ps.id_product SET ps.on_sale=1 WHERE cp.id_category = 8; Maybe somebody find it usefull 🙂 2 Link to comment Share on other sites More sharing options...
cucada Posted August 8, 2021 Share Posted August 8, 2021 (edited) On 6/19/2020 at 8:58 AM, CyberPepe said: Hola, Hicimos algo como esto, pero necesitábamos actualizar solo algunos productos con una categoría específica, así que lo hicimos (en phpMyAdmin con PS 1.6.0.5): ACTUALIZAR ps_product p INNER JOIN ps_category_product cp ON cp.id_product = p.id_product SET p.on_sale = 1 DONDE cp.id_category = 8; ACTUALIZAR ps_product_shop ps INNER JOIN ps_category_product cp ON cp.id_product = ps.id_product SET ps.on_sale = 1 DONDE cp.id_category = 8; Tal vez alguien lo encuentre útil 🙂 I have tested it and it works perfectly in PS 1.7 but it only activates the label in the product card but not in the category listing. could you tell me if you can activate the label in the product listing? thank you very much Edited August 8, 2021 by cucada (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 8, 2021 Share Posted August 8, 2021 @cucada If you share the site url then it will possible for us to give you the css code. Normally PrestaShop 1.7 classic theme do not have any list view by default Thank you Link to comment Share on other sites More sharing options...
cucada Posted August 9, 2021 Share Posted August 9, 2021 Hello thanks for the reply the store is now under construction and maintenance. the thema I have installed is ayon by roythemes Link to comment Share on other sites More sharing options...
cucada Posted August 10, 2021 Share Posted August 10, 2021 I have tried it and when selecting it manually it does appear in the list. Issue resolved the category was missing in the sentence now it is also displayed in the category list great contribution thank you very much 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