ebinx Posted April 17, 2016 Share Posted April 17, 2016 I am trying to achieve visibility set to none for all products out of stock (with quantity=0) and visibility set to both for products in stock (quantity>0) with code below. Unfortunately it does not work. Could anyone help me out solving this? <?php $link = mysql_connect('localhost', 'user', 'password'); if (!$link) { die('No connection possible: ' . mysql_error()); } mysql_select_db('prestashop'); mysql_query('UPDATE ps_product_shop SET visibility=none WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0)'); mysql_query('UPDATE ps_product_shop SET visibility=both WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0)'); ?> Link to comment Share on other sites More sharing options...
NemoPS Posted April 18, 2016 Share Posted April 18, 2016 You need quotes around "both" and "none". Use double quotes 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