【问题标题】:Magento - set discount on a product before the cartMagento - 在购物车之前为产品设置折扣
【发布时间】:2012-04-25 11:33:58
【问题描述】:

我是 magento 的新手,我正在开发一个允许用户选择并使用他购买的产品的模块。 我的问题是,如何在结账时为特定产品设置折扣? 我用过: 我在事件的观察者中进行修改

checkout_cart_add_product_complete

.

$_cart_products = Mage::getModel("checkout/cart") -> getItems();

//foreache...
//if ...

$_cart_product->setDiscountAmount($realPrice-$giftPrice);
$_cart_product->setBaseDiscountAmount($realPrice-$giftPrice);
$_cart_product->save();

但它不起作用 谢谢你的帮助:)

【问题讨论】:

  • 如果我使用优惠券代码,我会为一次使用生成很多!

标签: magento cart discount


【解决方案1】:

您不需要为此编写代码,只需进入管理,您将看到促销选项卡,只需选择此选项,您可以从这里定义产品的促销规则

【讨论】:

  • 我需要它是完全动态的,不需要添加规则。用户只需指定礼品产品以及与之关联的产品。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-28
  • 2011-04-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多