adding fields to order listing

  • Posts: 90
  • Thank you received: 1
11 years 6 months ago #101244

I was able to comment out certain fields on the view order / listing to cleanup our orders listing page. I want to add the shipment method to it though. Also I noticed in the documentation that the customers name shows up in the order listing. I am assuming that is only if the customer registers. If we don't have the customer register is there a way to get the first name and last name onto the order listing page?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #101388

Hi,

You can edit the view "order / lising" and add a column for the Shipping method, and use the var "$row->order_shipping_method" to display it.
To display the address informations like the name, you have to make a request to get the name in the table address where the address_id is equal to "$row->order_billing_address_id".

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

  • Posts: 90
  • Thank you received: 1
11 years 6 months ago #101873

I only understand a little bit of the reply. other entries in there look like this

" <td class="hikashop_order_date_value">
<?php echo hikashop_getDate($row->order_created,'%Y-%m-%d %H:%M');?>
</td> "

For a non-programmer what exactly do i need to put into the order/listing ?

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

  • Posts: 82728
  • Thank you received: 13343
  • MODERATOR
11 years 6 months ago #102075

You would add somethine like that for the shipping method:
<td class="hikashop_order_date_value">
<?php echo $row->order_shipping_method;?>
</td>

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

  • Posts: 90
  • Thank you received: 1
11 years 6 months ago #102186

1) That worked, but I realized that's not the right field. It gives me the right shipping method of "manual" but I set several methods up under manual. I set up USPS 1st Class, USPS Priority, USPS International 1st Class these are the ones I want to show up on the listing.

2) I would also like to put the customers 1st and last name on the order listing. I think it would be there if we had our customers register and login. But since we don't require them to register all that shows up is their email address. I have attached a picture of what our order listing looks like. Thank you for your help.

Attachments:

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

  • Posts: 82728
  • Thank you received: 13343
  • MODERATOR
11 years 6 months ago #102364

1. In that case, replace order_shipping_method by order_shipping_id in the code

2. That's more complex as that data is not available directly in the view.
You will have to first load it :

$class = hikashop_get('class.order');
$order = $class->loadFullOrder($row->order_id);
echo $order->billing_address->address_firstname;
echo $order->billing_address->address_lastname;

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

  • Posts: 90
  • Thank you received: 1
11 years 5 months ago #103750

1) I changed order_shipping_method to order_shipping_id but now all that shows up in my listing is a number. I assume that number correlates to to what I have set up under the manual shipping methods. Is there a way to get the name of those though. I tried changing it to order_shipping_name but nothing appears on the listing page when I do this. I would like for it to appear like it does at the bottom of the invoice.

2) I know I would like to add it after this code:
<th class="hikashop_order_customer_title title">
<?php echo JHTML::_('grid.sort', JText::_('CUSTOMER'), 'c.name',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
</th>
But I am not sure how to format it. Can I just copy the code you provided not sure where to put the code to load it either... Thanks for the help.

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

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 5 months ago #103868

Hi,

The "order_shipping_method" is the plugin name and the "order_shipping_id" is the ID in the hikashop shipping table.
If you want the final name, you have to load the configuration for this specific shipping_id and read the column "shipping_name".

For the header of the table, you can just use a classical column without sorting.

<th class="hikashop_order_customer_title title"><?php echo JText::_('CUSTOMER'); ?></th>
You have to create the cell in the body of the table too with this time the code given by Nicolas.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum