Toni Mármol Posted March 14, 2013 Share Posted March 14, 2013 Hello, I'm coding a little script to fix some issues on my multishop scenary and I need if there is a function to delete a product from a specific shop. For example, I need something like this: Product::delete($id_product, $id_shop); ... and this function must delete the rows in all tables related: ps_product_shop ps_attributte_shop ps_xxxx Is there any function? Or how can I do it? Thanks in advance. Link to comment Share on other sites More sharing options...
Toni Mármol Posted March 15, 2013 Author Share Posted March 15, 2013 (edited) Finally, I solved this with this code: <?php require(dirname(__FILE__).'/config/config.inc.php'); $id_lang = 1; $id_product = 3622; $id_shop = 11; $product = new Product($id_product, null, $id_lang, $id_shop, Context::getContext()->shop->setContext(Shop::CONTEXT_SHOP, $id_shop)); if ($product->delete()) echo "Product $id_product deleted from shop $id_shop"; Edited March 15, 2013 by anmaral79 (see edit history) Link to comment Share on other sites More sharing options...
JoelWebsites Posted February 13, 2015 Share Posted February 13, 2015 Is there any code to delete all images as well? 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