Custom Fields in (shipping) invoice

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
10 years 7 months ago #124405

Hi,

Displaying the shipping method name is not very easy.
For HikaShop 2.2.2, we introduce new email design with a lot of new improvements, like the product images, the display of shipping and payment methods, a responsive mail and many other cool things.
But HikaShop 2.2.2 is not yet release ; we are working hard to make a release as soon as possible. We want to publish it before the end of this month.

It is possible to display the shipping method name in the email but it require to "import" code from the order view (in the backend).

if(empty($this->order->order_shipping_method) && empty($this->order->shippings)) {
	echo '- <em>'.JText::_('NONE').'</em>';
} else if(!empty($this->order->order_shipping_method)) {
	if(!is_numeric($this->order->order_shipping_id)){
		$shipping_name = $this->getShippingName($this->order->order_shipping_method, $this->order->order_shipping_id);
		echo ' - ' . $shipping_name;
	}else{
		$shipping = $this->shippingClass->get($this->order->order_shipping_id);
		echo ' - ' . $shipping->shipping_name;
	}
} else {
	// Multi shipping display
}
Where "$this->getShippingName" is this function
function getShippingName($shipping_method, $shipping_id) {
	$shipping_name = $shipping_method . ' ' . $shipping_id;
	if(strpos($shipping_id, '-') !== false) {
		$shipping_ids = explode('-', $shipping_id, 2);
		$shipping = $this->shippingClass->get($shipping_ids[0]);
		if(!empty($shipping->shipping_params) && is_string($shipping->shipping_params))
			$shipping->shipping_params = unserialize($shipping->shipping_params);
		$shippingMethod = hikashop_import('hikashopshipping', $shipping_method);
		$methods = $shippingMethod->shippingMethods($shipping);
			if(isset($methods[$shipping_id])){
			$shipping_name = $shipping->shipping_name.' - '.$methods[$shipping_id];
		}else{
			$shipping_name = $shipping_id;
		}
	}
	return $shipping_name;
}
With some PHP and development knowledge, you can transpose this code to work in the current email system.
But if you can wait a little, I can assure you that the new email system is really cool :)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 11
  • Thank you received: 0
10 years 7 months ago #124455

Hey Bro, thanks a lot for your help...but i dint understand anything :s

However, I guess I will just wait for the release...do you have a release date yet?

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

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
10 years 7 months ago #124511

Hi,

During next week. We want to release it before the end of the month.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 11
  • Thank you received: 0
10 years 7 months ago #125798

Hey Jerome, any update on the release?

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

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

Hi,

You can download the latest version from our website.

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

  • Posts: 11
  • Thank you received: 0
10 years 7 months ago #126123

Hey Xavier,

I just updated my Hikashop Essential to 2.2.2 Ver. But how do I show the shipping & payment method in the invoices now? I was looking through it, but couldnt find a relevant option. Is it something in the front end or I need to enter some code somewhere?

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

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

Hi,

The shipping method name should be displayed in the emails and in the invoices.
If it is not the case, that's probably because you have a view override somewhere, thanks to remove the customization via the menu Display > Views.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum