Characteristics/product code on invoice

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128149

Hello- Can you please direct me to the files that I can edit to show the characteristics name on the invoice? I do not want it on the product page, so I have that disabled. But I would like it on the invoice, as it appears on the order screen in the backend.

I did numerous searches and saw to edit the file order/invoice, but I couldn't find such file, nor would I know what to do if I did find it.
Shown is picture of the invoice now, the product name and custom field is shown, but not the characteristics.

Thanks in advance!!

Attachments:
Last edit: 11 years 1 month ago by word.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 1 month ago #128166

Hi,

You'll be able to edit this file through "Hikashop->Display->Views" by editing the "invoice" file of your "order" view of your back-end template.

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

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128177

Thanks Mohamed, Can you please advise me on the code to place?

thanks

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #128295

Hi,

You need to be placed in the foreach "foreach($this->order->products as $product){"
and use something like:

$productClass = hikashop_get('class.product');
$fullProduct = $productClass->get($product->order_product_id);
$characteristic = str_replace('Product_with_variant_','',$fullProduct->product_code);
$db = JFactory::getDbo();
$db->setQuery("SELECT 'characteristic_id' FROM ".hikashop_table('characteristic')." WHERE 'characteristic_id' = ".(int)$characteristic);
$characteristic = $db->loadResult();
echo $characteristic;

This code is maybe wrong (not tested) but it's the way of doing that.

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

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128392

Thanks guys. I am still having a bit of trouble. Here is the best I could do:




It's in the right place, maybe the code is wrong? Maybe I placed it wrong? I don't know what to look for.

Thanks for you help.

Attachments:

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

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128427

OK, I have been working on this code and getting nowhere. :S Let me rephrase my request, maybe you guys have a better way of doing it. :)

I would like to display the product code on the invoice but not the product page.

The characteristics are set to show on the product page, and that works. But I would like the code on the invoice but not the product page. Is it possible?

Thanks for all your help!!!!

Last edit: 11 years 1 month ago by word.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
11 years 1 month ago #128474

You added the code in the HTML of the page, not in the PHP code of the page. So you need to add the tag <?php at the beginning and the tag ?> at the end so that the code is interpreted and not simply displayed like you have on your screenshot.

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

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128478

Thanks Nicolas. I think there may be an easier way to do this. How can I remove the product code from the product page? I would like to remove the numbers in the box.



Thanks

Attachments:
Last edit: 11 years 1 month ago by word.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #128490

Hi,

By using this css property:

.hikashop_product_page .hikashop_product_code_main{ display: none;}
Thanks to read our documentation about how to customize the layout:
www.hikashop.com/support/documentation/1...ize-the-display.html

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

  • Posts: 47
  • Thank you received: 1
11 years 1 month ago #128548

Got it! Thanks so much guys!

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

Time to create page: 0.098 seconds
Powered by Kunena Forum