I have seen several examples showing how to adjust prices in carts. I do not understand the difference between setCustomPrice and setOriginalCustomPrice. Where is CustomPrice and OriginalCustomPrice used later on?

class CustomPrice implements ObserverInterface
    public function execute(\Magento\Framework\Event\Observer $observer) {

        $price = $item->getProduct()->getFinalPrice()+60; 
        return $this;
  • Any update if my explenation works for you? Nov 4 '17 at 16:46
  • custom_price : new price that can be declared by user and recalculated during calculation process.

  • original_custom_price : original defined value of custom price without any convertion.

It will be safe to set both.

This link can be useful.


Both the SetCustomPrice and SetOriginalCustomPrice seems to be a part of the Quote Update system.

First lets understand the difference between ->setPrice() ->setOriginalPrice()

    • price - initial item price, declared during product association
    • original_price - product price before any calculations

Now the difference between setPrice and SetCustomPrice you already know i think. A price is the price of the product in your product stock. Custom Price is the price that you give it on your order.

So SetCustomPrice is the price you give it in your invoice and SetCustomOriginalPrice is the Product Price that you give it but before any calculations (before any discounts etc)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.