Know-how 19.10.2017 delivery, payment, tax

Cash on delivery with fee on invoice

How to show cash on delivery fee and associated fee tax on the invoice. Step by step guide related to my cash on delivery addon

If you wonder how to show cash on deivery fee with associated tax value on the invoice - check this guide. Tutorial is applicable for "cash on delivery with fee" module from my offer. The main problem in such case is fact that all cash on delivery modules do not have feature to show cod fee and cod fee tax on invoice. Just because prestashop is not ready to show custom taxes on invoices.

 

cash on delivery fee tax

 

As you can see on the screenshot above, COD Fee and COD Fee tax are included to the summary. This is how it should work. But by default it is not possible to achieve this in PrestaShop. This guide shows how to create such feature and show these additonal fees if selected payment method will be "cash on delivery with fee".

 

Modify invoice .tpl file

We have to alter theme file of invoice that is responsible for this part of invoice. Invoice template files are available in the directory "pdf" located in root dir of your prestashop. We need to alter file "invoice.total-tab.tpl". path to file is: /pdf/invoice.total-tab.tpl. Please open it and search for code:

	{if $footer.wrapping_tax_excl > 0}
		<tr>
			<td class="grey">
				{l s='Wrapping Cost' pdf='true'}
			</td>
			<td class="white">{displayPrice currency=$order->id_currency price=$footer.wrapping_tax_excl}</td>
		</tr>
	{/if}

Right after this code please insert this short if function code:

{if Module::isEnabled('codpro')}{codpro::returnCodForPdf($order)}{/if}

 

And that's all! Your invoices will show additonal fee and tax inside price summary properly.

Zdjęcie autora: Milosz Myszczuk

Artykuł napisany przez Milosza Myszczuka, eksperta PrestaShop i oficjalnego moderatora społeczności PrestaShop. CEO i założyciel agencji interaktywnej VEKIA. Dowiedz się więcej.

If you like this article, support our work!

Comments