Php code for shipping info in invoice pdf

  • Posts: 138
  • Thank you received: 1
10 years 8 months ago #149606

Hello i have your bussines and invoice plugin. I want the shipping method to show in this invoice. However i cant get the php working.

What i have now is:

<div class="date"><?php echo JText::_('HIKASHOP_SHIPPING_METHOD').': '.hikashop_getShipping;?></div>

It is not showing the shipping option that the customer choose. I gues because the last part of the code is wrong. Maybe you now what to put there?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 8 months ago #149633

Hello,
Note that your shipping method is already supposed to show through your invoice, can you remove the modifications that you've done through your invoice file and test it again ?
Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
10 years 8 months ago #149690

Hello i think we are talking about two different things.

Yes the shipping is showing in the e-mails we and the customer get. But im talking about the pdf file that is attacht to the e-mail with the plugin i did buy from you guys. And this does not have the shippingmethod on it. It does have the price on it but not the name.

So one is Fed ex for example a €3 and one is tnt for €4 euro. On the pdf you see €3 or €4 but not fedex or tnt.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #149979

Hi,

As Mohamed said, it should already be displayed at the end of the invoice.

Thanks to try to add the following code in the file:
"\plugins\hikashop\attachinvoice\attachinvoice\invoice.php"

		$pluginsPayment = hikashop_get('type.plugins');
		$pluginsPayment->type='payment';
		$pluginsShipping = hikashop_get('type.plugins');
		$pluginsShipping->type='shipping';

Just before:
if (!empty($pluginsShipping))

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
10 years 8 months ago #149980

OK well then its not there. I checked and the code if (!empty($pluginsShipping)) is also not in this file. The code that has shipping in it is like this:


if(!empty($order->order_shipping_method)){ ?>
<tr>
<td colspan="3" class="newarea">
<?php echo JText::_( 'SHIPPING' ); ?>
</td>
<td class="price" >
<?php
if($config->get('price_with_tax')){
echo $currencyHelper->format($order->order_shipping_price,$order->order_currency_id);
}else{
echo $currencyHelper->format($order->order_shipping_price-@$order->order_shipping_tax,$order->order_currency_id);
} ?>
</td>
</tr>
<?php }
if(!empty($order->additional)) {
$exclude_additionnal = explode(',', $config->get('order_additional_hide', ''));
foreach($order->additional as $additional) {
if(in_array($additional->name, $exclude_additionnal)) continue;
echo '<tr><td colspan="3" class="newarea">'. JText::_($additional->order_product_name).'</td><td class="price">';
if(!empty($additional->order_product_price) || empty($additionaltionnal->order_product_options)) {
if($config->get('price_with_tax')){
echo $currencyHelper->format($additional->order_product_price+@$additional->order_product_tax, $order->order_currency_id);
}else{
echo $currencyHelper->format($additional->order_product_price, $order->order_currency_id);
}
} else {
echo $additional->order_product_options;
}
echo '</td></tr>';
}

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #149982

Hi,

Near the end you sould have something like:

	<fieldset class="hikashop_order_custom_fields_fieldset">
		<legend>
			<?php echo JText::_('SHIPPING') .' & '. JText::_('HIKASHOP_PAYMENT_METHOD'); ?>
		</legend>
		<p>
		<?php
			if (!empty($pluginsShipping))
				echo JText::_('HIKASHOP_SHIPPING_METHOD').' : '.$pluginsShipping->getName($order->order_shipping_method, $order->order_shipping_id).'<br/>' ;
			if(!empty($pluginsPayment))
				echo JText::_('HIKASHOP_PAYMENT_METHOD').' : '.$pluginsPayment->getName($order->order_payment_method, $order->order_payment_id).'<br/>';
		?>
		</p>
	</fieldset>

If you don't have that, so your version is not the last one.
Thanks to update.

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
10 years 8 months ago #150101

Well lets see. I have checked all the updates joomla is showing. I have joomla 2519 i have hikashop Versie HikaShop [1403280125]

So i did go to this file invoice.php. And no there is no such code. I did control with Control f so its not me overlooking it. So maybe this plugin is old. (i did buy it a few weeks ago but ok) Why is there no update showing in joomla? Why dont i get an email? Where i can find this update? How do i install this? And is this deleting all the template changes i made?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #150281

Hi,

Indeed the plugin has been updated on the website this weekend.
Thanks to go to the address:
www.hikashop.com/my-account/my-orders.html

And open the order of the PDF invoice plugin, and download again the file.

To install it you have to use the Joomla extension manager as for any other plugin, module or component.
If you made changes in the invoice.php file of this plugin, they will be override, so I suggest to make a save in an external file and then put the changes back and keep the new features added by this update.

The following user(s) said Thank You: extreme

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
10 years 7 months ago #150283

OK that was indeed the problem. Thanks. For those who just want the code you need:

<fieldset class="hikashop_order_custom_fields_fieldset">
<legend>
<?php echo JText::_('SHIPPING') .' & '. JText::_('HIKASHOP_PAYMENT_METHOD'); ?>
</legend>
<p>
<?php
if (!empty($pluginsShipping))
echo JText::_('HIKASHOP_SHIPPING_METHOD').' : '.$pluginsShipping->getName($order->order_shipping_method, $order->order_shipping_id).'<br/>' ;
if(!empty($pluginsPayment))
echo JText::_('HIKASHOP_PAYMENT_METHOD').' : '.$pluginsPayment->getName($order->order_payment_method, $order->order_payment_id).'<br/>';
?>
</p>
</fieldset>
<br/>

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum