批量删除Magento 1.4的产品+
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了批量删除Magento 1.4的产品+相关的知识,希望对你有一定的参考价值。
The easiest way to pull this off is by means of a quick script. The key to this script is that the indexing functionality is disabled entirely for the process, then enabled again at the end – requiring a manual update at the end.In our case, we filtered the type of products by its “Data Set†– an attribute assigned to that batch of products, but you can change this to suit any means of filtering.
<?php "; require_once MAGENTO . '/app/Mage.php'; Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $products = Mage::getModel('catalog/product') ->getCollection() ->addFieldToFilter('data_set', 1544); $sql = ""; $undoSql = ""; for ($i=0; $i<=8; $i++) { $sql .= "UPDATE index_process SET mode = 'manual' WHERE index_process.process_id =$i LIMIT 1;"; $undoSql .= "UPDATE index_process SET mode = 'real_time' WHERE index_process.process_id =$i LIMIT 1;"; } $mysqli->query($sql); $count = 0; foreach($products as $product){ $product->delete(); if($count++%100 == 0) { "; } } "; $mysqli->query($undoSql); ?>
以上是关于批量删除Magento 1.4的产品+的主要内容,如果未能解决你的问题,请参考以下文章