Jump to content

PDF Invoice: Carrier not showing & trying to add category name


Recommended Posts

Dear All

 

FIRST:
I just try to figure out how to setup the invoice to display the chosen carrier. Actually when I look at the files invoice.tpl (where "{$shipping_tab}" is being called) and invoice.shipping-tab.tpl (where "{$carrier->name}" is being called), everything is looking fine and nearly the same as for the invoice.payment-tab.tpl for example, except that inside the payment tab, a foreach loop is made cycling through the getOrderPaymentCollection()...

 

The only thing I could think of is that I might have to use some similar loop for the carrier (e.g. getOrderShipmentCollection() or whatever) to make it being displayed on the invoice.

 

Or do I have to enable this somewhere else?

 

SECOND:

I also try to add the name of the products category to the product name. As the category name of a product is the same as the manufacturer, I'm a little bit of in luck.
I printed the whole content of the "order_detail" array on an invoice and the manufacturer ID is in there ({*$order_detail|@print_r*}).. So now I only would have to convert the id to the manufacturers name. I thought of somehow being able to use $smarty->assign() somewhere to create an array with the ids and names to later on use a smarty foreach loop to replace ids with names, but cannot figure out where I should put this in. Maybe there's even a simpler solution, but I haven't found anything related on the web yet.

 

I also found "id_category_default" within the order_detail var, but this number is somehow not the same as the category ID displayed in the shop so I thought of going with the manufacturer_id.

 

Thank you for trying to help!

All the best,

Oli

Link to comment
Share on other sites

  • 1 year later...
On 15/03/2017 at 12:32 PM, oliiix said:

Dear All

 

FIRST:
I just try to figure out how to setup the invoice to display the chosen carrier. Actually when I look at the files invoice.tpl (where "{$shipping_tab}" is being called) and invoice.shipping-tab.tpl (where "{$carrier->name}" is being called), everything is looking fine and nearly the same as for the invoice.payment-tab.tpl for example, except that inside the payment tab, a foreach loop is made cycling through the getOrderPaymentCollection()...

 

The only thing I could think of is that I might have to use some similar loop for the carrier (e.g. getOrderShipmentCollection() or whatever) to make it being displayed on the invoice.

 

Or do I have to enable this somewhere else?

 

SECOND:

I also try to add the name of the products category to the product name. As the category name of a product is the same as the manufacturer, I'm a little bit of in luck.
I printed the whole content of the "order_detail" array on an invoice and the manufacturer ID is in there ({*$order_detail|@print_r*}).. So now I only would have to convert the id to the manufacturers name. I thought of somehow being able to use $smarty->assign() somewhere to create an array with the ids and names to later on use a smarty foreach loop to replace ids with names, but cannot figure out where I should put this in. Maybe there's even a simpler solution, but I haven't found anything related on the web yet.

 

I also found "id_category_default" within the order_detail var, but this number is somehow not the same as the category ID displayed in the shop so I thought of going with the manufacturer_id.

 

Thank you for trying to help!

All the best,

Oli

 

Some position here? I have the same problem with the carrier not appearing in the invoice PDF file. The stranger is, in my local machine (localhost), the carrier name appears in the PDF. I tried updating invoice.tpl and invoice.shipping-tab.tpl to the host server where is my website, but nothing changes. Acttualy the files were identical.

Is there someone to help us? Thanks!

Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

the same issue here in November 2022 (

for some reason the content of //pdf/invoice.shipping-tab.tpl is not appearing in the final invoice.tpl

as a work around to add content (table) of invoice.shipping-tab.tpl into //pdf/invoice.payment-tab.tpl

Result of //pdf/invoice.payment-tab.tpl:

<table id="payment-tab" width="100%">
	<tr>
		<td class="payment center small grey bold" width="44%">{l s='Payment Method' d='Shop.Pdf' pdf='true'}</td>
		<td class="payment left white" width="56%">
			<table width="100%" border="0">
				{foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
					<tr>
						<td class="right small">{$payment->payment_method}</td>
						<td class="right small">{displayPrice currency=$payment->id_currency price=$payment->amount}</td>
					</tr>
				{/foreach}
			</table>
		</td>
	</tr>
</table>
<tr>
  <td colspan="12" height="10">&nbsp;</td>
</tr>
<table id="shipping-tab" width="100%">
	<tr>
		<td class="shipping center small grey bold" width="44%">{l s='Carrier' d='Shop.Pdf' pdf='true'}</td>
		<td class="shipping center small white" width="56%">{$carrier->name}</td>
	</tr>
</table>

 

Edited by Yulia Vitun (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...