Skip to main content

Ad Company Name to Order & Customer Lists

More
11 years 3 months ago #207332 by ichimonban
-- 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.

More
11 years 3 months ago #207351 by Jerome
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
Code:
onBeforeOrderListing($paramBase, &$extrafilters, &$pageInfo, &$filters, &$tables, &$searchMap)

Regards,

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

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

More
10 years 5 months ago #240293 by thirdhatch
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:
Code:
<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?

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

More
10 years 5 months ago #240321 by Jerome
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.

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

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