Ad Company Name to Order & Customer Lists

  • Posts: 31
  • Thank you received: 1
8 years 10 months ago #207332

-- url of the page with the problem -- : cottoncandy.rocks
-- HikaShop version -- : 2.5.0
-- HikaMarket version -- : 1.6.4
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Chrome latest

I would like to have a column in the order list & client list for the clients company name and it be searchable, How do I accomplish this for both hikashop and hikamarket?


MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co

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

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
8 years 10 months ago #207351

Hi,

To add new columns in the listing, it could be done using a view override.
Every views in HikaShop and HikaMarket can be overridden, so you can customize them to add a column and display the information you want.

To make the field searchable, it requires a small custom plugin.
Thanks to the trigger "onBeforeOrderListing", you can modify the content of the variable "$searchMap" and add the fields that you want to make available in the search.
Depending from where come the field "company", you might need to also add a "join" in order to include another database table for the query which get the listing content.

www.hikashop.com/support/support/documen...r-documentation.html

onBeforeOrderListing($paramBase, &$extrafilters, &$pageInfo, &$filters, &$tables, &$searchMap)

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: 17
  • Thank you received: 0
8 years 1 day ago #240293

I have a similar goal in the Orders view: I would like to add the Customer's company name above the customer name (see 1st screenshot) , and have the column sortable by the Company name (or by customer name if the there is no company name). Looking at order > listing.php, it seems I would need top add the company name somewhere around line 140:

<td class="hikashop_order_customer_value">
						ECHO COMPANY NAME HERE?
						<?php
						 echo $row->hikashop_name;
						 if(!empty($row->username)){
						 	echo ' ( '.$row->username.' )';
						 }
						 echo '<br/>';
						 if(!empty($row->user_id)){
							 $url = hikashop_completeLink('user&task=edit&cid[]='.$row->user_id);
							 $config =& hikashop_config();
							 if(hikashop_isAllowed($config->get('acl_user_manage','all'))) echo $row->user_email.'<a href="'.$url.$target.'"><img src="'.HIKASHOP_IMAGES.'edit.png" alt="edit"/></a>';
						 }elseif(!empty($row->user_email)){
						 	echo $row->user_email;
						 }
						 ?>
					</td>

I tried adding a line for the custom field parameter address_company (see 2nd screenshot) but nothing appeared.


If that's too difficult, how can I override the layout for order/listing.php to simply include a separate column for the company name. That is, can you say what the correct parameter/syntax is for for this value?

Attachments:

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

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
8 years 17 hours ago #240321

Hi,

This is the HikaMarket section of the forum where I provide support for HikaMarket.
Your question is related to HikaShop ; please create a new thread in the HikaShop section ; where the HikaShop support team will be able to help you.

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.045 seconds
Powered by Kunena Forum