Magento 2: setCustomPrice vs. setOriginalCustomPrice The 2019 Stack Overflow Developer Survey Results Are InMagento Addto cart lowest priceSpecial prices are not displaying in magentoHide prices in Magento articleMagento calculate priceMagento Real Time product price updateSet custom price of product when adding to cart code not workingMagento 2: Add a product to the cart programmaticallyBulk price updates in Magento ver. 1.9.3.1I have created one field using product form field for my price i want save my field value at product creation time from backend magento2Magento 2.2.5: Add, Update and Delete existing products Custom Options

Is a "Democratic" Feudal System Possible?

Right tool to dig six foot holes?

Do these rules for Critical Successes and Critical Failures seem Fair?

What did it mean to "align" a radio?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Am I thawing this London Broil safely?

Identify boardgame from Big movie

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Did Section 31 appear in Star Trek: The Next Generation?

Did 3000BC Egyptians use meteoric iron weapons?

Origin of "cooter" meaning "vagina"

Can you compress metal and what would be the consequences?

Output the Arecibo Message

Geography at the pixel level

Multiply Two Integer Polynomials

Button changing it's text & action. Good or terrible?

Why is the maximum length of OpenWrt’s root password 8 characters?

Falsification in Math vs Science

How to notate time signature switching consistently every measure

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Is three citations per paragraph excessive for undergraduate research paper?

How can I autofill dates in Excel excluding Sunday?

How to obtain Confidence Intervals for a LASSO regression?

Is "plugging out" electronic devices an American expression?



Magento 2: setCustomPrice vs. setOriginalCustomPrice



The 2019 Stack Overflow Developer Survey Results Are InMagento Addto cart lowest priceSpecial prices are not displaying in magentoHide prices in Magento articleMagento calculate priceMagento Real Time product price updateSet custom price of product when adding to cart code not workingMagento 2: Add a product to the cart programmaticallyBulk price updates in Magento ver. 1.9.3.1I have created one field using product form field for my price i want save my field value at product creation time from backend magento2Magento 2.2.5: Add, Update and Delete existing products Custom Options



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















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(MagentoFrameworkEventObserver $observer)


$item=$observer->getEvent()->getData('quote_item');
$product=$observer->getEvent()->getData('product');
$price = $item->getProduct()->getFinalPrice()+60;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
return $this;











share|improve this question






















  • Any update if my explenation works for you?

    – CompactCode
    Nov 4 '17 at 16:46

















0















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(MagentoFrameworkEventObserver $observer)


$item=$observer->getEvent()->getData('quote_item');
$product=$observer->getEvent()->getData('product');
$price = $item->getProduct()->getFinalPrice()+60;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
return $this;











share|improve this question






















  • Any update if my explenation works for you?

    – CompactCode
    Nov 4 '17 at 16:46













0












0








0








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(MagentoFrameworkEventObserver $observer)


$item=$observer->getEvent()->getData('quote_item');
$product=$observer->getEvent()->getData('product');
$price = $item->getProduct()->getFinalPrice()+60;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
return $this;











share|improve this question














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(MagentoFrameworkEventObserver $observer)


$item=$observer->getEvent()->getData('quote_item');
$product=$observer->getEvent()->getData('product');
$price = $item->getProduct()->getFinalPrice()+60;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
return $this;








magento2 price






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 29 '17 at 19:36









JensJens

11119




11119












  • Any update if my explenation works for you?

    – CompactCode
    Nov 4 '17 at 16:46

















  • Any update if my explenation works for you?

    – CompactCode
    Nov 4 '17 at 16:46
















Any update if my explenation works for you?

– CompactCode
Nov 4 '17 at 16:46





Any update if my explenation works for you?

– CompactCode
Nov 4 '17 at 16:46










2 Answers
2






active

oldest

votes


















3















  • 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.






share|improve this answer






























    0














    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)






    share|improve this answer























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "479"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f199143%2fmagento-2-setcustomprice-vs-setoriginalcustomprice%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3















      • 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.






      share|improve this answer



























        3















        • 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.






        share|improve this answer

























          3












          3








          3








          • 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.






          share|improve this answer














          • 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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 7 at 8:45









          VikalpVikalp

          716




          716























              0














              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)






              share|improve this answer



























                0














                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)






                share|improve this answer

























                  0












                  0








                  0







                  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)






                  share|improve this answer













                  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)







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 29 '17 at 22:40









                  CompactCodeCompactCode

                  1,592725




                  1,592725



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f199143%2fmagento-2-setcustomprice-vs-setoriginalcustomprice%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

                      Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?