How can i get the order total value on success page easily? Magento 2.2Convert Order to Quote and Load to Current CartHow to get order Grand Total from information about order's items (products)?Magento 2 Get order details on success page?Magento 2 Order Object ErrorHow to Get MRP, Product Order Quantity, Address line1, Address line 2 in Order Success page Magento 2Magento 2 : How to load the order success pageHow to get last ordered product details in Magento 2.2?$block Class Some Method is won't appear in get_class_methods() callget payment method in the success page Magento 2 programmaticallyHow can I add custom success page

How to give very negative feedback gracefully?

Are we obligated to aspire to be Talmidei Chachamim?

Should one double the thirds or the fifth in chords?

What are the differences between credential stuffing and password spraying?

Would "lab meat" be able to feed a much larger global population

Do I really need diodes to receive MIDI?

Moving the subject of the sentence into a dangling participle

What does a yield inside a yield do?

To customize a predefined symbol with different colors

Sub query result is 0

Returning the outputs of a nested structure

Casual versus formal jacket

How do I tell my manager that his code review comment is wrong?

Theorem won't go to multiple lines and is causing text to run off the page

What is the most remote airport from the center of the city it supposedly serves?

In Endgame, why were these characters still around?

Is Cola "probably the best-known" Latin word in the world? If not, which might it be?

I may be a fraud

How to make a newline without autoindent

How could a planet have most of its water in the atmosphere?

If Earth is tilted, why is Polaris always above the same spot?

Why is B♯ higher than C♭ in 31-ET?

Identifying a transmission to myself

I caught several of my students plagiarizing. Could it be my fault as a teacher?



How can i get the order total value on success page easily? Magento 2.2


Convert Order to Quote and Load to Current CartHow to get order Grand Total from information about order's items (products)?Magento 2 Get order details on success page?Magento 2 Order Object ErrorHow to Get MRP, Product Order Quantity, Address line1, Address line 2 in Order Success page Magento 2Magento 2 : How to load the order success pageHow to get last ordered product details in Magento 2.2?$block Class Some Method is won't appear in get_class_methods() callget payment method in the success page Magento 2 programmaticallyHow can I add custom success page






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








1















I am trying to get the order value from success.phtml page so that I can report it back in the facebook pixel.



I am just looking for the simplest way to get the order value. Yes, a shortcut pretty much.



I tried this:



$orderTotal = round($block->getGrandTotal(), 2);


and also



$lastOrderId = $block->getOrderId();
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($lastOrderId);
echo "order id: ". $lastOrderId;
echo $order->getGrandTotal();


and several other methods but the total order value seems to be hard to find.










share|improve this question






























    1















    I am trying to get the order value from success.phtml page so that I can report it back in the facebook pixel.



    I am just looking for the simplest way to get the order value. Yes, a shortcut pretty much.



    I tried this:



    $orderTotal = round($block->getGrandTotal(), 2);


    and also



    $lastOrderId = $block->getOrderId();
    $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $order = $objectManager->create('MagentoSalesModelOrder')->load($lastOrderId);
    echo "order id: ". $lastOrderId;
    echo $order->getGrandTotal();


    and several other methods but the total order value seems to be hard to find.










    share|improve this question


























      1












      1








      1








      I am trying to get the order value from success.phtml page so that I can report it back in the facebook pixel.



      I am just looking for the simplest way to get the order value. Yes, a shortcut pretty much.



      I tried this:



      $orderTotal = round($block->getGrandTotal(), 2);


      and also



      $lastOrderId = $block->getOrderId();
      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $order = $objectManager->create('MagentoSalesModelOrder')->load($lastOrderId);
      echo "order id: ". $lastOrderId;
      echo $order->getGrandTotal();


      and several other methods but the total order value seems to be hard to find.










      share|improve this question
















      I am trying to get the order value from success.phtml page so that I can report it back in the facebook pixel.



      I am just looking for the simplest way to get the order value. Yes, a shortcut pretty much.



      I tried this:



      $orderTotal = round($block->getGrandTotal(), 2);


      and also



      $lastOrderId = $block->getOrderId();
      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $order = $objectManager->create('MagentoSalesModelOrder')->load($lastOrderId);
      echo "order id: ". $lastOrderId;
      echo $order->getGrandTotal();


      and several other methods but the total order value seems to be hard to find.







      magento2.2 orders grand-total order-success-page






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 27 at 16:01









      ARUNPRABAKARAN M

      641114




      641114










      asked Apr 27 at 12:25









      user3091199user3091199

      516




      516




















          1 Answer
          1






          active

          oldest

          votes


















          0














          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
          $grandtotal = $order->getGrandTotal();
          ?>
          <?php echo $grandtotal; ?>





          share|improve this answer

























          • That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

            – user3091199
            Apr 27 at 18:08












          • Can you able to get the last order id in success.phtml

            – ARUNPRABAKARAN M
            yesterday











          • Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

            – user3091199
            yesterday












          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%2f272681%2fhow-can-i-get-the-order-total-value-on-success-page-easily-magento-2-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
          $grandtotal = $order->getGrandTotal();
          ?>
          <?php echo $grandtotal; ?>





          share|improve this answer

























          • That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

            – user3091199
            Apr 27 at 18:08












          • Can you able to get the last order id in success.phtml

            – ARUNPRABAKARAN M
            yesterday











          • Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

            – user3091199
            yesterday
















          0














          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
          $grandtotal = $order->getGrandTotal();
          ?>
          <?php echo $grandtotal; ?>





          share|improve this answer

























          • That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

            – user3091199
            Apr 27 at 18:08












          • Can you able to get the last order id in success.phtml

            – ARUNPRABAKARAN M
            yesterday











          • Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

            – user3091199
            yesterday














          0












          0








          0







          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
          $grandtotal = $order->getGrandTotal();
          ?>
          <?php echo $grandtotal; ?>





          share|improve this answer















          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
          $grandtotal = $order->getGrandTotal();
          ?>
          <?php echo $grandtotal; ?>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered Apr 27 at 12:35









          ARUNPRABAKARAN MARUNPRABAKARAN M

          641114




          641114












          • That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

            – user3091199
            Apr 27 at 18:08












          • Can you able to get the last order id in success.phtml

            – ARUNPRABAKARAN M
            yesterday











          • Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

            – user3091199
            yesterday


















          • That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

            – user3091199
            Apr 27 at 18:08












          • Can you able to get the last order id in success.phtml

            – ARUNPRABAKARAN M
            yesterday











          • Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

            – user3091199
            yesterday

















          That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

          – user3091199
          Apr 27 at 18:08






          That did not work at all. Resulted in critical error sadly. Was I supposed to use this in the success.phtml page?

          – user3091199
          Apr 27 at 18:08














          Can you able to get the last order id in success.phtml

          – ARUNPRABAKARAN M
          yesterday





          Can you able to get the last order id in success.phtml

          – ARUNPRABAKARAN M
          yesterday













          Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

          – user3091199
          yesterday






          Yes I am able to get the last order id using: ```$lastOrderId = $block->getOrderId();````

          – user3091199
          yesterday


















          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%2f272681%2fhow-can-i-get-the-order-total-value-on-success-page-easily-magento-2-2%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form