- Posts: 20
- Thank you received: 0
Change fields in orders backend
Please Log in or Create an account to join the conversation.
You need to edit the file "form" of the view "order" for your back end template via the menu Display->Views and change the line:
<?php echo $this->order->customer->name.' ('.$this->order->customer->username.')'; ?>
to:
<?php echo $this->order->billing_address->address_firstname.' '.$this->order->billing_address->address_lastname; ?>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Could you do a screenshot ? The screenshot you attached to your message doesn't seem to be the correct one.
Indeed that code is for the customer address first and last names. For the company name it's similar:
<?php echo $this->order->billing_address->address_company; ?>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I thought that you were talking about the customer information on the order details page.
For the orders listing, it's more difficult to do as that information is not loaded on the listing.
You would have to first load it with a MySQL query and then you would be able to display the address company.
You can do that in the file "listing" of the view "order" of the back end via the menu Display->Views
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
"load it with a MySQL query and then you would be able to display the address company.
You can do that in the file "listing" of the view "order" of the back end via the menu Display->Views"
Please Log in or Create an account to join the conversation.
$addressClass = hikashop_get('class.address');
$address = $addressClass->get($row->order_billing_address_id);
echo $address->address_company;
Please Log in or Create an account to join the conversation.
<?php
$addressClass = hikashop_get('class.address');
$address = $addressClass->get($row->order_billing_address_id);
echo $address->address_company;
?>
to replace this line:
<?php echo $this->order->customer->name.' ('.$this->order->customer->username.')'; ?>
And it does not work
Please Log in or Create an account to join the conversation.
You're not editing the correct view file.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 608
- Thank you received: 13
Can an extra field be inserted to show the shipping cost or shipping method name?
thanks
Please Log in or Create an account to join the conversation.
The listing of orders ? The orders information ? The invoice ? On the front end or the back end ?
Please Log in or Create an account to join the conversation.
- Posts: 608
- Thank you received: 13
Please Log in or Create an account to join the conversation.
The shipping method information is in $row->order_shipping_id (you will have to load the shipping information from the database to display the name:
$class = hikashop_get('class.shipping');
$shipping = $class->get($row->order_shipping_id);
echo $shipping->shipping_name;
and the shipping cost is in: $row>->order_shipping_price.
Please Log in or Create an account to join the conversation.