Adding custom field to order listing

  • Posts: 33
  • Thank you received: 0
6 years 1 month ago #289204

-- HikaShop version -- : 3.3.0 business
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.1.14
-- Browser(s) name and version -- : Firefox 58.0.2 (64 bits)

Hi,

I have created a custom field where the customer can specify his own reference for each order during check out,
this work well,

however I'm looking for a way to add this reference as a column into the customer order listing, next to order number column,
I know I should edit the order/listing.php file but I dont find how to recover and display the specified custom field,

in same way, I would like to have the "print invoice" button directly displayed in the order listing in a new column next to order number column,

thanks for help

(btw any news on Hikashop next release ? I'll need it for the new option of locking the billing adress)

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

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
6 years 1 month ago #289214

Hi,

Getting the value in the custom field is really easy.
You can use such code:
<?php echo $row->XXX; ?>
where XXX is the column name of your custom field.

For the link of the print invoice button, you can use such code:

		global $Itemid;
		$url_itemid = '';
		if(!empty($Itemid)) {
			$url_itemid = '&Itemid=' . $Itemid;
		}
		$url = 'order&task=invoice&order_id='.$row->order_id.$url_itemid;
		$token = hikaInput::get()->getVar('order_token');
		if(!empty($token))
			$url .= '&order_token='.urlencode($token);
		echo hikashop_completeLink($url, true);
(next release is scheduled for mid march)

The following user(s) said Thank You: dylis

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

  • Posts: 33
  • Thank you received: 0
6 years 1 month ago #289242

Thanks,

easy indeed for custom field, I was expecting something much more complicated,

havent included the invoice yet in orders listing , but I have installed the PDF invoice plugin and Im getting the following error when trying to generate confirmation email :

The html tag [br] is not known by Html2Pdf not exists



as well, when the PDF invoice plugin is set to overide front-end or back-end, the invoice button doesnt work,

any idea where the problem is ?

Last edit: 6 years 1 month ago by dylis.

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

  • Posts: 33
  • Thank you received: 0
6 years 1 month ago #289248

I must precise,

the plugin does work when the customer paies by credit card,

it does not work when the customer paies by bank transfer, or anything that requiere admin action to confirm the order,

when admin try to confirm order then the error code given happens, and no mail is sent to customer

This message contains confidential information

Last edit: 6 years 1 month ago by dylis.

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

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
6 years 1 month ago #289250

Hi,

In the information text area of your payment methods, you had written </br> instead of <br/>
Because of that, the HTML2PDF library that the PDF invoice plugin uses couldn't properly analyze the HTML and it generated that error.
I've fixed the tag for you and it's working find now.

The following user(s) said Thank You: dylis

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

  • Posts: 33
  • Thank you received: 0
6 years 1 month ago #289251

oh, lol

thank you

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

Time to create page: 0.065 seconds
Powered by Kunena Forum