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

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

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?