Products ordered by model number on invoice and shipping bill

  • Posts: 11
  • Thank you received: 0
6 years 2 months ago #297959

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.11

Hello,

I am trying to get the products ordered by model number on the invoice and shipping bill.
I know it is in Display-->View-->Order-->Invoice.php and believe it is in this piece of text around line 105:

<th class="title" width="60%">
<?php echo JText::_('PRODUCT'); ?>
</th>
<?php if ($this->config->get('show_code')) { $colspan++; ?>
<th class="title" ><?php echo JText::_('CART_PRODUCT_CODE'); ?></th>
<?php } ?>

As I don't know PHP I think I need to put somewhere ASC to get the products ordered by model number. Can anybody help me and tell me where to put it, Please?

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

  • Posts: 11
  • Thank you received: 0
6 years 2 months ago #297990

Just found this threat on the forum that solved my question:

www.hikashop.com/forum/4-how-to/7067-ord...rint-on-invoice.html

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 2 months ago #297991

Hello,

Modifying the HikaShop core to change that behavior will work but is not something recommended since you will lost your modification with the next update.
Using a view override is much more appreciate for that.
www.hikashop.com/support/documentation/1...-display.html#layout

Regarding your first message and the modification ; unfortunately no, it is not there that part that you want to customize.
If you want to change the sort ; you must do it before that line

foreach($this->order->products as $product) {
Before in the "foreach" block, all your products will be display one by one ; following the current order in the array or products.

Please note that such kind of modification in the view requires PHP knowledge.
The usage of the PHP function "usort" could be interesting for your case.
us3.php.net/manual/en/function.usort.php
And do not hesitate to use debug function like "var_dump" to display content of variable ; it helps to know the content of product objects and find which elements you can use for your code.
us3.php.net/manual/en/function.var-dump.php

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.056 seconds
Powered by Kunena Forum