- Posts: 17
- Thank you received: 0
Add customer's Company Name to Orders view
- thirdhatch
-
Topic Author
- Offline
Less
More
10 years 4 months ago #240364
by thirdhatch
Add customer's Company Name to Orders view was created by thirdhatch
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5.34
I would like to add the Customer's company name to the Orders view, either by:
Using the custom field parameter address_company (see 2nd screenshot) but I don't think I had the correct syntax. Also I don't know if this would make the column sortable by the company name.
If that's too complicated to do, how can I override the layout for order/listing.php to simply include a separate column for the company name? Is there a similar example I can refer to (I've searched but haven't found one yet) and is address_company the correct parameter to call?
Thank you for your assistance!
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5.34
I would like to add the Customer's company name to the Orders view, either by:
- Adding it above the customer name in the customer column
- Or adding the company name as a separate column
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>
Using the custom field parameter address_company (see 2nd screenshot) but I don't think I had the correct syntax. Also I don't know if this would make the column sortable by the company name.
If that's too complicated to do, how can I override the layout for order/listing.php to simply include a separate column for the company name? Is there a similar example I can refer to (I've searched but haven't found one yet) and is address_company the correct parameter to call?
Thank you for your assistance!
Please Log in or Create an account to join the conversation.
10 years 4 months ago #240367
by nicolas
Replied by nicolas on topic Add customer's Company Name to Orders view
Hi,
It should be quite easy to add. Try with that code:
<?php echo $row->address_company; ?>
It should be quite easy to add. Try with that code:
<?php echo $row->address_company; ?>
The following user(s) said Thank You: thirdhatch
Please Log in or Create an account to join the conversation.
- thirdhatch
-
Topic Author
- Offline
Less
More
- Posts: 17
- Thank you received: 0
10 years 4 months ago #240499
by thirdhatch
Replied by thirdhatch on topic Add customer's Company Name to Orders view
Thank you for the quick response Nicolas!
This is what I originally added. this but the company name does not display.
I tried both
and
Any thoughts on why the address_company is not being displayed?
It should be quite easy to add. Try with that code:
<?php echo $row->address_company; ?>
This is what I originally added. this but the company name does not display.
I tried both
Code:
<td class="hikashop_order_customer_value">
<?php echo $row->address_company; ?>
<?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>
Code:
<td class="hikashop_order_customer_value">
<?php echo $row->address_company;
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>
Please Log in or Create an account to join the conversation.
10 years 4 months ago #240512
by nicolas
Replied by nicolas on topic Add customer's Company Name to Orders view
Hi,
Then it might be because you have an old version of HikaShop.
I think that we've added the loading of the billing address data in $row only in recent versions of HikaShop.
So updating should make it work, at least it works on my end and I don't see any other reason why it wouldn't.
Then it might be because you have an old version of HikaShop.
I think that we've added the loading of the billing address data in $row only in recent versions of HikaShop.
So updating should make it work, at least it works on my end and I don't see any other reason why it wouldn't.
Please Log in or Create an account to join the conversation.
- thirdhatch
-
Topic Author
- Offline
Less
More
- Posts: 17
- Thank you received: 0
10 years 4 months ago - 10 years 4 months ago #240996
by thirdhatch
Replied by thirdhatch on topic Add customer's Company Name to Orders view
Can you please confirm with certainty that these changes were added to Hikashop Business between v2.4.0 and v2.6.3? I don't want to purchase a new version of Hikashop if this is not the case. Thanks!I think that we've added the loading of the billing address data in $row only in recent versions of HikaShop.
Last edit: 10 years 4 months ago by thirdhatch.
Please Log in or Create an account to join the conversation.
10 years 4 months ago #241009
by nicolas
Replied by nicolas on topic Add customer's Company Name to Orders view
Hi,
I confirm that this was added later and that the code I gave earlier is working with recent versions of HikaShop (I(ve just tested it myself).
I confirm that this was added later and that the code I gave earlier is working with recent versions of HikaShop (I(ve just tested it myself).
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds