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!
Best 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)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 theas="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 atapp/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:
Hope this helps! Let me know if you need anything clarified.