Jump to content

Edit History

millien

millien

<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.inc.php');
include(dirname(__FILE__) . '/init.php');
$res = Db::getInstance()->executeS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE id_product = "76" ');
echo "<p>(".date('Y/m/d H:i:s').") Starting to delete products...</p>";
if ($res) {
    foreach ($res as $row) {
        echo "<p>(".date('Y/m/d H:i:s').") Deleting product with ID <b>".$row['id_product']."</b>...";
        $p = new Product($row['id_product']);
        if(!$p->delete()) {
            echo " <span style='color: red'>Error deleting this product!</span></p>";
        } else {
            echo " <span style='color: green'>DELETED</span></p>";
        }

    }
}
?>

 

I tried one product product ID 76 after I run it the product deletes from backoffice  , but in the DB I can se the row both in ps_product and ps_product_shop , We have multistore 

millien

millien

<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.inc.php');
include(dirname(__FILE__) . '/init.php');
$res = Db::getInstance()->executeS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE id_product = "76" ');
echo "<p>(".date('Y/m/d H:i:s').") Starting to delete products...</p>";
if ($res) {
    foreach ($res as $row) {
        echo "<p>(".date('Y/m/d H:i:s').") Deleting product with ID <b>".$row['id_product']."</b>...";
        $p = new Product($row['id_product']);
        if(!$p->delete()) {
            echo " <span style='color: red'>Error deleting this product!</span></p>";
        } else {
            echo " <span style='color: green'>DELETED</span></p>";
        }

    }
}
?>

 

I tried one product product ID 76 after I run it the product deletes from backoffice  , but in the DB I can se the row both in ps_product and ps_product_shop , We have multistore 

×
×
  • Create New...