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;
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
add a comment |
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
add a comment |
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
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
magento2.2 orders grand-total order-success-page
edited Apr 27 at 16:01
ARUNPRABAKARAN M
641114
641114
asked Apr 27 at 12:25
user3091199user3091199
516
516
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$grandtotal = $order->getGrandTotal();
?>
<?php echo $grandtotal; ?>
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$grandtotal = $order->getGrandTotal();
?>
<?php echo $grandtotal; ?>
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
add a comment |
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$grandtotal = $order->getGrandTotal();
?>
<?php echo $grandtotal; ?>
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
add a comment |
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$grandtotal = $order->getGrandTotal();
?>
<?php echo $grandtotal; ?>
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$grandtotal = $order->getGrandTotal();
?>
<?php echo $grandtotal; ?>
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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