How to get the order html table and shipping address on success page?












0















I'm working on a customized success page and I would like to get that same table from cart to display on success page, I mean, it should contain product thumb, product name with configurable options (in my case, size and color), quantity ordered and price for each item, and on the foot, shipping price, coupon description and value and grand total.



Additionally, I need to show the customer's shipping address.



That will be a default success page for current and future projects, so I preferred to work without modules and make customisation directly on success page phtml file.



Please note that I'm just the front-end guy, so I have no knowledge in advanced development/backend development.



Thanks in advance for helping!










share|improve this question

























  • Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

    – heraldo
    Apr 17 '17 at 3:30











  • I think I'm okay, no problem. Just post an example and I will try to follow.

    – joaogdesigner
    Apr 17 '17 at 20:15
















0















I'm working on a customized success page and I would like to get that same table from cart to display on success page, I mean, it should contain product thumb, product name with configurable options (in my case, size and color), quantity ordered and price for each item, and on the foot, shipping price, coupon description and value and grand total.



Additionally, I need to show the customer's shipping address.



That will be a default success page for current and future projects, so I preferred to work without modules and make customisation directly on success page phtml file.



Please note that I'm just the front-end guy, so I have no knowledge in advanced development/backend development.



Thanks in advance for helping!










share|improve this question

























  • Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

    – heraldo
    Apr 17 '17 at 3:30











  • I think I'm okay, no problem. Just post an example and I will try to follow.

    – joaogdesigner
    Apr 17 '17 at 20:15














0












0








0








I'm working on a customized success page and I would like to get that same table from cart to display on success page, I mean, it should contain product thumb, product name with configurable options (in my case, size and color), quantity ordered and price for each item, and on the foot, shipping price, coupon description and value and grand total.



Additionally, I need to show the customer's shipping address.



That will be a default success page for current and future projects, so I preferred to work without modules and make customisation directly on success page phtml file.



Please note that I'm just the front-end guy, so I have no knowledge in advanced development/backend development.



Thanks in advance for helping!










share|improve this question
















I'm working on a customized success page and I would like to get that same table from cart to display on success page, I mean, it should contain product thumb, product name with configurable options (in my case, size and color), quantity ordered and price for each item, and on the foot, shipping price, coupon description and value and grand total.



Additionally, I need to show the customer's shipping address.



That will be a default success page for current and future projects, so I preferred to work without modules and make customisation directly on success page phtml file.



Please note that I'm just the front-end guy, so I have no knowledge in advanced development/backend development.



Thanks in advance for helping!







magento-1.9 shopping-cart order-grid order-success-page






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '18 at 8:10









John

693520




693520










asked Apr 16 '17 at 9:23









joaogdesignerjoaogdesigner

138418




138418













  • Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

    – heraldo
    Apr 17 '17 at 3:30











  • I think I'm okay, no problem. Just post an example and I will try to follow.

    – joaogdesigner
    Apr 17 '17 at 20:15



















  • Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

    – heraldo
    Apr 17 '17 at 3:30











  • I think I'm okay, no problem. Just post an example and I will try to follow.

    – joaogdesigner
    Apr 17 '17 at 20:15

















Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

– heraldo
Apr 17 '17 at 3:30





Are you okay with rebuilding the HTML? You can't repurpose the shopping cart table because it contains things that let it modify the quantity/other actions. You can, however just rebuild the HTML and get the list of products on the success.phtml file. To do it in a cleaner way, you can add an XML block with your own template (does not require a module). I'll put an example if you're good with that.

– heraldo
Apr 17 '17 at 3:30













I think I'm okay, no problem. Just post an example and I will try to follow.

– joaogdesigner
Apr 17 '17 at 20:15





I think I'm okay, no problem. Just post an example and I will try to follow.

– joaogdesigner
Apr 17 '17 at 20:15










1 Answer
1






active

oldest

votes


















0














I'd recommend adding a block via XML with its own template. It'll make it a little cleaner since it won't fill up the success.phtml file.



Step 1:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml (This file is optional, so if you don't have one, create one)



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- success page view -->
<checkout_onepage_success>
<!-- references the main body of the page -->
<reference name="content">
<block type="checkout/onepage_success" name="whatever.you.want" as="order_items" template="checkout/success/items.phtml" />
</reference>
</checkout_onepage_success>
</layout>


Step 2:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success.phtml file, add the following call to request the block we just created. You can place it anywhere you'd like it to show up.



<?php echo $this->getChildHtml('order_items') ?>



The order_items references the as="order_items" attribute in my example local.xml file, so you can change it to whatever you'd like. Just make sure to change both of them.



Step 3:



As you can see, we're referencing a phtml that doesn't exist in the template="checkout/success/items.phtml" attribute. You need to create this file at that location. (You can change this location to whatever you'd like)
So for this example, it should be at app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success/items.phtml



In this file we can get the items and various data from the items with something like:



<?php
/*
* joaogdesigner
* custom items for the success page
*
* @category design
* @package your_package
* @block Mage_Checkout_Onepage_Success
*
*/
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$total = $order->getGrandTotal(); // grand total
?>

<?php foreach( $items as $item ): ?>

Product ID: <?php echo $item->getProductId(); ?>
Name: <?php echo $item->getName(); ?>
Qty: <?php echo $item->getQtyOrdered(); ?>
Price: <?php echo $item->getPrice(); ?>

<?php endforeach; ?>


Hope this helps! Let me know if you need anything clarified.






share|improve this answer
























  • Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

    – joaogdesigner
    Apr 18 '17 at 1:17











  • You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

    – heraldo
    Apr 18 '17 at 2:23











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%2f170351%2fhow-to-get-the-order-html-table-and-shipping-address-on-success-page%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














I'd recommend adding a block via XML with its own template. It'll make it a little cleaner since it won't fill up the success.phtml file.



Step 1:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml (This file is optional, so if you don't have one, create one)



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- success page view -->
<checkout_onepage_success>
<!-- references the main body of the page -->
<reference name="content">
<block type="checkout/onepage_success" name="whatever.you.want" as="order_items" template="checkout/success/items.phtml" />
</reference>
</checkout_onepage_success>
</layout>


Step 2:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success.phtml file, add the following call to request the block we just created. You can place it anywhere you'd like it to show up.



<?php echo $this->getChildHtml('order_items') ?>



The order_items references the as="order_items" attribute in my example local.xml file, so you can change it to whatever you'd like. Just make sure to change both of them.



Step 3:



As you can see, we're referencing a phtml that doesn't exist in the template="checkout/success/items.phtml" attribute. You need to create this file at that location. (You can change this location to whatever you'd like)
So for this example, it should be at app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success/items.phtml



In this file we can get the items and various data from the items with something like:



<?php
/*
* joaogdesigner
* custom items for the success page
*
* @category design
* @package your_package
* @block Mage_Checkout_Onepage_Success
*
*/
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$total = $order->getGrandTotal(); // grand total
?>

<?php foreach( $items as $item ): ?>

Product ID: <?php echo $item->getProductId(); ?>
Name: <?php echo $item->getName(); ?>
Qty: <?php echo $item->getQtyOrdered(); ?>
Price: <?php echo $item->getPrice(); ?>

<?php endforeach; ?>


Hope this helps! Let me know if you need anything clarified.






share|improve this answer
























  • Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

    – joaogdesigner
    Apr 18 '17 at 1:17











  • You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

    – heraldo
    Apr 18 '17 at 2:23
















0














I'd recommend adding a block via XML with its own template. It'll make it a little cleaner since it won't fill up the success.phtml file.



Step 1:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml (This file is optional, so if you don't have one, create one)



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- success page view -->
<checkout_onepage_success>
<!-- references the main body of the page -->
<reference name="content">
<block type="checkout/onepage_success" name="whatever.you.want" as="order_items" template="checkout/success/items.phtml" />
</reference>
</checkout_onepage_success>
</layout>


Step 2:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success.phtml file, add the following call to request the block we just created. You can place it anywhere you'd like it to show up.



<?php echo $this->getChildHtml('order_items') ?>



The order_items references the as="order_items" attribute in my example local.xml file, so you can change it to whatever you'd like. Just make sure to change both of them.



Step 3:



As you can see, we're referencing a phtml that doesn't exist in the template="checkout/success/items.phtml" attribute. You need to create this file at that location. (You can change this location to whatever you'd like)
So for this example, it should be at app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success/items.phtml



In this file we can get the items and various data from the items with something like:



<?php
/*
* joaogdesigner
* custom items for the success page
*
* @category design
* @package your_package
* @block Mage_Checkout_Onepage_Success
*
*/
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$total = $order->getGrandTotal(); // grand total
?>

<?php foreach( $items as $item ): ?>

Product ID: <?php echo $item->getProductId(); ?>
Name: <?php echo $item->getName(); ?>
Qty: <?php echo $item->getQtyOrdered(); ?>
Price: <?php echo $item->getPrice(); ?>

<?php endforeach; ?>


Hope this helps! Let me know if you need anything clarified.






share|improve this answer
























  • Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

    – joaogdesigner
    Apr 18 '17 at 1:17











  • You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

    – heraldo
    Apr 18 '17 at 2:23














0












0








0







I'd recommend adding a block via XML with its own template. It'll make it a little cleaner since it won't fill up the success.phtml file.



Step 1:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml (This file is optional, so if you don't have one, create one)



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- success page view -->
<checkout_onepage_success>
<!-- references the main body of the page -->
<reference name="content">
<block type="checkout/onepage_success" name="whatever.you.want" as="order_items" template="checkout/success/items.phtml" />
</reference>
</checkout_onepage_success>
</layout>


Step 2:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success.phtml file, add the following call to request the block we just created. You can place it anywhere you'd like it to show up.



<?php echo $this->getChildHtml('order_items') ?>



The order_items references the as="order_items" attribute in my example local.xml file, so you can change it to whatever you'd like. Just make sure to change both of them.



Step 3:



As you can see, we're referencing a phtml that doesn't exist in the template="checkout/success/items.phtml" attribute. You need to create this file at that location. (You can change this location to whatever you'd like)
So for this example, it should be at app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success/items.phtml



In this file we can get the items and various data from the items with something like:



<?php
/*
* joaogdesigner
* custom items for the success page
*
* @category design
* @package your_package
* @block Mage_Checkout_Onepage_Success
*
*/
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$total = $order->getGrandTotal(); // grand total
?>

<?php foreach( $items as $item ): ?>

Product ID: <?php echo $item->getProductId(); ?>
Name: <?php echo $item->getName(); ?>
Qty: <?php echo $item->getQtyOrdered(); ?>
Price: <?php echo $item->getPrice(); ?>

<?php endforeach; ?>


Hope this helps! Let me know if you need anything clarified.






share|improve this answer













I'd recommend adding a block via XML with its own template. It'll make it a little cleaner since it won't fill up the success.phtml file.



Step 1:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml (This file is optional, so if you don't have one, create one)



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- success page view -->
<checkout_onepage_success>
<!-- references the main body of the page -->
<reference name="content">
<block type="checkout/onepage_success" name="whatever.you.want" as="order_items" template="checkout/success/items.phtml" />
</reference>
</checkout_onepage_success>
</layout>


Step 2:



In your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success.phtml file, add the following call to request the block we just created. You can place it anywhere you'd like it to show up.



<?php echo $this->getChildHtml('order_items') ?>



The order_items references the as="order_items" attribute in my example local.xml file, so you can change it to whatever you'd like. Just make sure to change both of them.



Step 3:



As you can see, we're referencing a phtml that doesn't exist in the template="checkout/success/items.phtml" attribute. You need to create this file at that location. (You can change this location to whatever you'd like)
So for this example, it should be at app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/success/items.phtml



In this file we can get the items and various data from the items with something like:



<?php
/*
* joaogdesigner
* custom items for the success page
*
* @category design
* @package your_package
* @block Mage_Checkout_Onepage_Success
*
*/
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$total = $order->getGrandTotal(); // grand total
?>

<?php foreach( $items as $item ): ?>

Product ID: <?php echo $item->getProductId(); ?>
Name: <?php echo $item->getName(); ?>
Qty: <?php echo $item->getQtyOrdered(); ?>
Price: <?php echo $item->getPrice(); ?>

<?php endforeach; ?>


Hope this helps! Let me know if you need anything clarified.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 17 '17 at 22:51









heraldoheraldo

714




714













  • Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

    – joaogdesigner
    Apr 18 '17 at 1:17











  • You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

    – heraldo
    Apr 18 '17 at 2:23



















  • Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

    – joaogdesigner
    Apr 18 '17 at 1:17











  • You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

    – heraldo
    Apr 18 '17 at 2:23

















Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

– joaogdesigner
Apr 18 '17 at 1:17





Many thanks man, I will try and I go back here to tell you if it worked. Just a question: when I have to add a new code here in stackoverflow, I need to add a new answer since I can't use bbcode on comments?

– joaogdesigner
Apr 18 '17 at 1:17













You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

– heraldo
Apr 18 '17 at 2:23





You can highlight code in the comments using the backtick ` before and after the code. like this. But if it's a lot of code, it's better to edit your question instead.

– heraldo
Apr 18 '17 at 2:23


















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%2f170351%2fhow-to-get-the-order-html-table-and-shipping-address-on-success-page%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

William S. Burroughs

Eda skans

1924