Programmatically add product to cart with price change

前端 未结 6 1333
孤街浪徒
孤街浪徒 2020-11-28 20:44

I want to add a product to cart programmatically. Also, I want to change the product price when added to cart.

Suppose, my product\'s price is $100. I wanted to cha

6条回答
  •  星月不相逢
    2020-11-28 20:49

    Magento have changed the way the prices are calculated in the cart which makes it very difficult to do this in v1.4 onwards. If you do set the price using an Observer or other device, it will almost certainly be overwritten back to the catalog price.

    Effectively, you need to use Shopping Cart rules to implement this.

提交回复
热议问题