Il modulo gratuito Ottimizzatore Prestashop consente, fra le varie cose, di azzerare l’intero catalogo (prodotti, categorie, attributi ecc.) di un negozio basato su Prestashop.
Aggiornamento del 2/11/2021: Questo modulo è disponibile per Prestashop 1.6, ma non è più supportato per Prestashop 1.7.
L’ultima versione disponibile si può scaricare da GitHub https://github.com/PrestaShop/pscleaner
Nel caso si rendesse necessario cancellare solo gli articoli di un negozio Prestashop è possibile utilizzare lo script php allegato
<?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` ORDER BY `id_product` DESC LIMIT 100 '); 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>"; } } } ?> <script> window.location.reload(); </script>
Maggiori dettagli nel forum ufficiale di Prestashop https://www.prestashop.com/forums/topic/609319-solved-delete-massive-products-from-database-10420-products/