magento批量修改价格
来源:互联网 发布:手机域名注册管理局 编辑:程序博客网 时间:2024/06/10 20:15
<?phprequire_once 'app/Mage.php';//echo phpinfo();exit;set_time_limit(0);Mage::app('default');$read = Mage::getSingleton('core/resource')->getConnection('core_read');$row = $read->fetchAll("select p.`entity_id` from `catalog_product_entity` as p, `catalog_product_entity_decimal` as d where p.`entity_id` = d.`entity_id` and d.`attribute_id` =79 and d.`value` not in (0,868,444)");//$products = Mage::getModel('catalog/category')->load(75)->getProductCollection();foreach($row as $val){$product = Mage::getModel('catalog/product')->load($val['entity_id']);$cost = $product->getCost();$price = $product->getPrice();$special_price = $product->getSpecialPrice();if(!empty($cost)){$cost = $cost/6.1;//echo $product->getId() . '----';if(!empty($special_price)){//$special_price = $special_price + 1.5;//$product->setData('special_price', $special_price);if($cost >= $special_price){$price = $cost + 15/6.1;$special_price = $cost + 10/6.1;$product->setData('price', $price);$product->setData('special_price', $special_price);echo $product->getId() . '----' . $special_price . 's----' . $cost."<br>";}}else{if($cost >= $price){$price = $cost + 10/6.1;$product->setData('price', $price);echo $product->getId() . '----' . $price . 'p----' . $cost."<br>";}}//$price = $price + 1.5;//$product->setData('price', $price);$product->save();//exit;}}?>
0 0
- magento批量修改价格
- MR21批量修改价格
- magento,批量修改产品名称
- 批量修改Magento产品名称
- MR21批量修改物料价格-BDC
- MR21批量修改物料价格-BDC
- Magento 产品添加购物车时修改价格
- 批量修改magento产品库存数量
- Magento执行原生SQL,批量修改商品价格
- magento -- 修改所有商品的价格为原来的1.2倍示例
- 批量更新价格
- Mangeto批量修改价格:把price的值赋值给special price
- magento批量删除产品
- magento批量改价
- magento 免邮费价格根据打折后的价格设置
- magento自定义按价格浏览范围
- Magento利用价格(price)筛选商品
- 多网店下修改价格倍数
- TextView行距等设置
- hdu4712-随机化算法
- 移动端开发路在何方
- 7、斐波那契数列 & 8、跳台阶 & 9、变态跳台阶
- ids for this class must be manually assigned before calling save()
- magento批量修改价格
- SpringMVC form表单 上传多个文件
- 感知机算法及应用学习笔记
- MySql 错误1067,1045( Can't open and lock privilege tables: Table 'mysql.user' doesn't exist)
- Jquery Validate 相关参数及常用的自定义验证规则
- MySQL——关于MySQL分组查询group by和order by获取最新时间内容的方法
- Teamviewer的简介
- 对display:table-cell的学习
- 读取配置文件工具类外挂在jar