Same invoice on front-end as on backend

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
11 years 4 months ago #112706

Hi,

We bought Hikamarket to let one of our volunteers do the order processing and shipping.

We want him to print our invoice of our hikashop as we do from the backend / administrator in frontend.

How can we set hikamarket to show the hikashop administrator invoice on front-end?

I tried to copy and past the invoice code from backend hikashop to backend invoice file of hikamarket, but I got an error because shipping adress template does not exist.

But We want someone to handle our orders in frontend, without being a new vendor.

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

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
11 years 4 months ago #112711

Hi,

By default HikaMarket let users (who have the right) to access to the order and display/print the invoices.
You can see in the demo website (using the "demo / demo" credentials) that you have two buttons to display the invoice and the shipping invoice:
demo.hikashop.com/index.php?option=com_h...1&Itemid=844&lang=en

The invoice in front-end of HikaMarket and in the backend of HikaShop is a little bit different.
If you use the same content than in the backend, it won't work because as you said, the view "address template" does not exists.
That's why HikaMarket load this view directly from HikaShop:

<?php
	$params = null; $js = null;
	$html = hikamarket::getLayout('shop.address', 'address_template', $params, $js);
	foreach($this->element->fields as $field) {
		$fieldname = $field->field_namekey;
		$html = str_replace('{'.$fieldname.'}', $this->fieldsClass->show($field, $this->element->billing_address->$fieldname), $html);
	}
	echo str_replace("\n","<br/>\n",trim(str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)),"\n"));
?>
In the same way, the variable "$this->config" is the HikaMarket configuration object and the variable "$this->shopConfig" is the HikaShop config.

About your user, you just have to let him the access right to only access to the order, without editing rights (or maybe the order status).
He would be able to list, to show and to display the invoices.
The default invoice in HikaMarket is the same than in HikaShop backend. Because there are different components and there are running in a different context (front-end / back-end) the view can't be the exact same. But we tried to have something very similar.

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.

Moderators: Obsidev
Time to create page: 0.057 seconds
Powered by Kunena Forum