- Posts: 20
- Thank you received: 0
How to display delivery method in orders list
13 years 1 month ago #120025
by marioli
How to display delivery method in orders list was created by marioli
Hi,
I want to see what delivery method has been selected by the customer.
I want to see it as another column in a table that lists my orders on the Joomla/HikaShop backend.
How could I do that? I was able to add custom field as a column, but I cannot find a way to add this standard information. Also, I would want to hide 'last modification date' column, as I don't need it and it takes space.
Best Regards and thanks,
Mariusz
I want to see what delivery method has been selected by the customer.
I want to see it as another column in a table that lists my orders on the Joomla/HikaShop backend.
How could I do that? I was able to add custom field as a column, but I cannot find a way to add this standard information. Also, I would want to hide 'last modification date' column, as I don't need it and it takes space.
Best Regards and thanks,
Mariusz
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120039
by Eliot
Replied by Eliot on topic How to display delivery method in orders list
Hi there,
You just need edit the listing view of order (Display>Views) and remove these lines of code:
That will delete the last modified column. About the payment method, just add this where you delete the first code:
and this where you deleted the second code:
It should work
You just need edit the listing view of order (Display>Views) and remove these lines of code:
Code:
<th class="hikashop_order_modified_title title">
<?php echo JHTML::_('grid.sort', JText::_('HIKA_LAST_MODIFIED'), 'b.order_modified', $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
</th>
Code:
<td class="hikashop_order_modified_value">
<?php echo hikashop_getDate($row->order_modified,'%Y-%m-%d %H:%M');?>
</td>
That will delete the last modified column. About the payment method, just add this where you delete the first code:
Code:
<th class="hikashop_order_modified_title title">
<?php echo JHTML::_('grid.sort', JText::_('SHIPPING_METHOD'), 'b.shipping_method', $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
</th>
and this where you deleted the second code:
Code:
<td class="hikashop_order_shipping_value">
<?php if(!empty($row->order_shipping_method)){
if(!empty($this->shippings[$row->order_shipping_method])){
echo $this->shippings[$row->order_shipping_method]->shipping_name;
}else{
echo $row->order_shipping_method;
}
} ?>
</td>
It should work
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120056
by marioli
Replied by marioli on topic How to display delivery method in orders list
Thank You,
almost works.
The problem is that it displays the 'plugin' name, that is 'manual', and not the name that is displayed on the front-end, where customer selects the shipping method.
almost works.
The problem is that it displays the 'plugin' name, that is 'manual', and not the name that is displayed on the front-end, where customer selects the shipping method.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120077
by Eliot
Replied by Eliot on topic How to display delivery method in orders list
unfortunately this is the only information you can have easily. If you want the whole name you'll have to write a query on the database using the shipping id (which you can find in product_shipping_id). It's a little bit more complicated and require some php skills. The easiest way is to load every shipping method and use their id as a key. Put it in a table like $shipping_methods and you should be able to access the name with something like: $shipping_methods[$row->product_shipping_id]->shipping_name;
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120124
by marioli
Replied by marioli on topic How to display delivery method in orders list
I must admit that this is quite disappointing. Such an obvious functionality, such hard to achieve. Somehow it is displayed correctly on the order details page, but cannot be easily displayed on orders summary. Unfortunaletty my PHP skills are just enough to copy code snippet to the right place, but not more...
Anyway, thank You for Your time
Anyway, thank You for Your time
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120129
by marioli
Replied by marioli on topic How to display delivery method in orders list
I have managed to do this the easy and dirty way, but at least it's working:
if($row->order_shipping_id < 3) {
echo 'Poczta';
} else if($row->order_shipping_id < 5) {
echo 'Kurier';
} else if($row->order_shipping_id == 5) {
echo 'Odbiór';
} else {
echo 'Inna';
}
also, it's good to change sorting definition, it should be:
'b.order_shipping_id'
not
'b.shipping_method'
if($row->order_shipping_id < 3) {
echo 'Poczta';
} else if($row->order_shipping_id < 5) {
echo 'Kurier';
} else if($row->order_shipping_id == 5) {
echo 'Odbiór';
} else {
echo 'Inna';
}
also, it's good to change sorting definition, it should be:
'b.order_shipping_id'
not
'b.shipping_method'
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds