How to display delivery method in orders list

  • Posts: 20
  • Thank you received: 0
11 years 3 months ago #120025

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

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

  • Posts: 2334
  • Thank you received: 403
11 years 3 months ago #120039

Hi there,

You just need edit the listing view of order (Display>Views) and remove these lines of 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>
<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:
<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:
<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.

  • Posts: 20
  • Thank you received: 0
11 years 3 months ago #120056

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.

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

  • Posts: 2334
  • Thank you received: 403
11 years 3 months ago #120077

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.

  • Posts: 20
  • Thank you received: 0
11 years 3 months ago #120124

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

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

  • Posts: 20
  • Thank you received: 0
11 years 3 months ago #120129

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'

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

Time to create page: 0.072 seconds
Powered by Kunena Forum