//把所有产品的Special Price的值,给Group Price
//然后清空Special Price的值
$handle = Mage::getSingleton('core/resource')->getConnection('core_write');
/*
* catalog_product_entity_decimal表里 attribute_id字段为76的 value值就是 Special Price的值
* */
$sql = "SELECT entity_id,`value` from catalog_product_entity_decimal WHERE attribute_id=76";
$query = $handle->query($sql);
while ($row = $query->fetch()) {
$row = new Varien_Object($row);
$entity_id = $row->getentity_id();
$value = $row->getValue();
if(!empty($value)){
$sql = "INSERT INTO catalog_product_entity_group_price (`entity_id`,`all_groups`,`customer_group_id`,`VALUE`) VALUES (".$entity_id.",0,1,".$value.")";
$handle->query($sql);
}
}
//最后清空所有产品Special Price的值
//$sql3 = "DELETE FROM catalog_product_entity_decimal WHERE attribute_id=76";
//$handle->query($sql3);
Magento 把所有产品的Special Price的值,给Group Price,然后清空Special Price的值
最新推荐文章于 2021-03-09 19:49:28 发布