<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NemoPS &#187; resume</title>
	<atom:link href="https://nemops.com/tag/resume/feed/" rel="self" type="application/rss+xml" />
	<link>https://nemops.com</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Wed, 05 Dec 2018 13:25:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>Displaying the order resume at the Order Confirmation in Prestashop</title>
		<link>https://nemops.com/prestashop-order-confirmation-resume/</link>
		<comments>https://nemops.com/prestashop-order-confirmation-resume/#comments</comments>
		<pubDate>Mon, 15 Jun 2015 09:23:20 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[products]]></category>
		<category><![CDATA[resume]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2445</guid>
		<description><![CDATA[<p>Customers love visual feedback, and most of them often like to see a resume of their order right after pay. Let&#8217;s see how to display the order resume on the order confirmation page in Prestashop. Creating a simple module The best way to add new elements to the order confirmation page, in Prestashop, is through [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-order-confirmation-resume/">Displaying the order resume at the Order Confirmation in Prestashop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Customers love visual feedback, and most of them often like to see a resume of their order right after pay. Let&#8217;s see how to display the order resume on the order confirmation page in Prestashop.</p>
<a class="download-files button style1" href="http://nemops.com/wp-content/uploads/2015/06/confirmation_resume.zip" title="Download Project Files">Download Project Files</a>
<p><span id="more-2445"></span></p>
<h2>Creating a simple module</h2>
<p>The best way to add new elements to the order confirmation page, in Prestashop, is through a very simple module that hooks to <strong>orderConfirmation</strong>. Even if you are not familiar with advanced coding, this very step should be pretty simple to follow.</p>
<p>First off, download the sample module archive you find at the beginning of the article. Open it and place the first <strong>psconfresume</strong> folder you see inside <em>modules/</em>.</p>
<p>Navigate to it, and open <strong>psconfresume.php</strong> in your favorite code editor, then paste in the following, inside php tags:</p>
<pre class="brush: php; title: ; notranslate">
if (!defined('_PS_VERSION_'))
	exit;

class psConfResume extends Module
{

	protected $_errors = array();


	public function __construct()
	{
		$this-&gt;name = 'psconfresume';
		$this-&gt;tab = 'front_office_features';
		$this-&gt;version = '1.0';
		$this-&gt;author = 'Nemo';
		$this-&gt;need_instance = 0;


		$this-&gt;bootstrap = true;


	 	parent::__construct();

		$this-&gt;displayName = $this-&gt;l('psconfresume');
		$this-&gt;description = $this-&gt;l('Adds a block.');
		$this-&gt;confirmUninstall = $this-&gt;l('Are you sure you want to delete this module?');
	}
	
	public function install()
	{
		if (!parent::install() OR
			!$this-&gt;registerHook('orderConfirmation')
			)
			return false;
		return true;
	}
	
	public function uninstall()
	{
		if (!parent::uninstall())
			return false;
		return true;
	}
}
</pre>
<p>These are just the barebones of a module. Just make sure you register the orderConfirmation hook if you do it from scratch.</p>
<h3>Assigning parameters to the hook</h3>
<p>Once done with the basic setup, we need to do something with the hook. Add the following as last method:</p>
<pre class="brush: php; title: ; notranslate">

	public function hookOrderConfirmation($params)
	{

		$order = $params['objOrder'];
		$products = $order-&gt;getProducts();

		$this-&gt;context-&gt;smarty-&gt;assign(array(
			'order'=&gt; $order,
			'order_products' =&gt; $products
		));
		
		return $this-&gt;display(__FILE__, 'confirmation.tpl');
	}
</pre>
<p>There is nothing too fancy going on here. First, we take advantage of the <strong>order</strong> object, which comes through the $params array, and use it to get more details on the ordered products. Then, we simply assign both variables to the template, returning it in the end. Make sure this .tpl file is located inside the module&#8217;s folder, <em>views/templates/hook</em>.</p>
<div class="separator"></div>
<h2>The order resume table</h2>
<p>At this point, we are just throwing in an empty template, so we need to fill it with data. Open up <strong>views/templates/hook/confirmation.tpl</strong> and paste the following (yeah it&#8217;s long):</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
&lt;table class=&quot;std&quot;&gt;
	&lt;thead&gt;
		&lt;tr&gt;
			&lt;th&gt;{l s='Product' mod='psconfresume'}&lt;/th&gt;
			&lt;th&gt;{l s='Price' mod='psconfresume'}&lt;/th&gt;
			&lt;th&gt;{l s='Qty' mod='psconfresume'}&lt;/th&gt;
		&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
		{foreach from=$order_products item=product}
			&lt;tr&gt;
				&lt;td&gt;{$product.product_name}&lt;/td&gt;
				&lt;td&gt;
					{if $use_taxes}
						{displayPrice price=$product.total_price_tax_incl}
					{else}
						{displayPrice price=$product.total_price_tax_excl}
					{/if}
				&lt;/td&gt;
				&lt;td&gt;{$product.product_quantity}&lt;/td&gt;
			&lt;/tr&gt;
		{/foreach}
	&lt;/tbody&gt;
	&lt;tfoot&gt;
		&lt;tr&gt;
			&lt;td style=&quot;text-align:right&quot;&gt;
				{l s='Products Total' mod='psconfresume'}
			&lt;/td&gt;
			&lt;td colspan=&quot;2&quot;&gt;
				{if $use_taxes}
					{displayPrice price=$order-&gt;total_products_wt}
				{else}
					{displayPrice price=$order-&gt;total_products}
				{/if}
				
			&lt;/td&gt;
		&lt;/tr&gt;	
		&lt;tr&gt;
			&lt;td style=&quot;text-align:right&quot;&gt;
				{l s='Shipping' mod='psconfresume'}
			&lt;/td&gt;
			&lt;td colspan=&quot;2&quot;&gt;
				{if $use_taxes}
					{displayPrice price=$order-&gt;total_shipping_tax_incl}
				{else}
					{displayPrice price=$order-&gt;total_shipping_tax_excl}
				{/if}
				
			&lt;/td&gt;
		&lt;/tr&gt;
		{if $order-&gt;total_discounts != '0.00'}
			&lt;tr&gt;
				&lt;td style=&quot;text-align:right&quot;&gt;
					{l s='Discounts' mod='psconfresume'}
				&lt;/td&gt;
				&lt;td colspan=&quot;2&quot;&gt;-
					{if $use_taxes}
						{displayPrice price=$order-&gt;total_discounts_tax_incl}
					{else}
						{displayPrice price=$order-&gt;total_discounts_tax_excl}
					{/if}
				&lt;/td&gt;
			&lt;/tr&gt;
		{/if}
		{if $use_taxes}
			&lt;tr&gt;
				&lt;td style=&quot;text-align:right&quot;&gt;
					{l s='Taxes Paid' mod='psconfresume'}
				&lt;/td&gt;
				&lt;td colspan=&quot;2&quot;&gt;
					{$taxamt = $order-&gt;total_paid_tax_incl - $order-&gt;total_paid_tax_excl}
					{displayPrice price=$taxamt}

				&lt;/td&gt;
			&lt;/tr&gt;
		{/if}
		&lt;tr&gt;
			&lt;td style=&quot;text-align:right&quot;&gt;
				{l s='TOTAL' mod='psconfresume'}
			&lt;/td&gt;
			&lt;td colspan=&quot;2&quot;&gt;
				{if $use_taxes}
					{displayPrice price=$order-&gt;total_paid_tax_incl}
				{else}
					{displayPrice price=$order-&gt;total_paid_tax_excl}
				{/if}
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tfoot&gt;
&lt;/table&gt;
</pre>
<p>I didn&#8217;t break it into steps because it&#8217;s quite simple: we create a table with Product name, price and quantity as headers. Then, in the body, we loop through products themselves and display what we need. Lastly, we take care of shipping, discounts, taxes and total in the tfoot element. Please notice I used the $use_taxes variable to detect whether or not we have to display the taxed amount. You might want to tweak these parts depending on your needs, such as adding gift wrap as well or using DIV tags instead of a table.</p>
<p>That is basically it, create and order and see if everything works:</p>
<p><a href="http://nemops.com/wp-content/uploads/2015/06/order_confirmation_resume.png"><img src="http://nemops.com/wp-content/uploads/2015/06/order_confirmation_resume-680x288.png" alt="Prestashop order confirmation resume" width="680" height="288" class="aligncenter size-large wp-image-2451" /></a></p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-order-confirmation-resume/">Displaying the order resume at the Order Confirmation in Prestashop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-order-confirmation-resume/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
