hakeryk2 Posted July 11, 2017 Share Posted July 11, 2017 (edited) Hello community, I have a question - I have like 500 products to disable (not delete) - I still want to have them in the shop but EDIT (SOLVED) Nevermind, kinda easy xD $products_to_disable = Db::getInstance()->executeS(' SELECT id_product FROM ps_product WHERE available_for_order = 0 AND date_upd < "2017-05-01 00:00:00" '); foreach ($products_to_disable as $product) { $p = new ProductCore($product['id_product']); $p->active = false; $p->save(); echo 'Disabled '.ProductCore::getProductName($p->id).'<br>'; } Edited July 11, 2017 by hakeryk2 (see edit history) 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