更新cart item的price
来源:互联网 发布:php房屋租赁管理系统 编辑:程序博客网 时间:2024/05/17 08:10
$quote = Mage::getModel('checkout/cart')->getQuote(); $_cartItems = $quote->getAllVisibleItems(); foreach ($_cartItems as $_cartItem) { $productId = $_cartItem->getData('product_id'); $_cartItem->setOriginalCustomPrice($newprice); } $quote->collectTotals(); $quote->save();
注意:如果使用sales_quote_add_item这个observer,代码如下
public function updatePrice( $observer ){ $event = $observer->getEvent(); $quote_item = $event->getQuoteItem(); $new_price = 200; $quote_item->setOriginalCustomPrice($new_price); $quote_item->setTotalPrice(350);}
- 更新cart item的price
- 更新cart中的item的custom option值
- Magento网站,cart的Qty改变时即时更新价格
- 发现了magento 中"Shopping Cart Price Rules"一个bug
- magento Shopping Cart Price Rule 购物车促销规则
- Magento——利用购物车促销规则(Shopping Cart Price Rules)实现自己的功能第一章: 添加新的动作(Actions)
- Magento——利用购物车促销规则(Shopping Cart Price Rules)实现自己的功能第二章: 购物车页面判断设置的规则和动作
- 列表控件更新指定item的UI
- Price
- Price
- HOW to Use QP_PREQ_PUB.PRICE_REQUEST API to Price an Item
- CART树的剪枝
- Print the amount of items and total price of Magento's cart
- 更新order的item的custom option的值
- cart
- CART
- CART
- CART
- 移除USB设备占用COM端口号
- 浅谈 java对象的初始化
- Linux文件系统简介
- iOS个人开发者帐号申请难点讲解
- _IO
- 更新cart item的price
- perl模块Getopt::Std用法及实例-从命令行读取参数模块
- 在MAC下使用gitosis来配置git服务
- hdu 2033
- js报错:JSON.parse: unexpected character
- Android源码下载网站
- 策略模式(Strategy)实例分析与讲解
- 集合中几个比较重要的接口和类简介
- java.net.URL类详解