Product code in PDF invoice

  • Posts: 64
  • Thank you received: 1
  • Hikashop Business
2 months 1 week ago #334239

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.28
-- PHP version -- : 7.4
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : none

Hi,

We want to have the product code in the PDF invoice. How can we do that?

Kind regards,
Raoul

Attachments:

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

  • Posts: 73703
  • Thank you received: 11298
  • MODERATOR
2 months 1 week ago #334242

Hi,

The product code will actually display automatically on the invoice if you have the "show product code" setting activated in the HikaShop configuration. Note that this setting will also activate the display of the product code on the product details page, and other places.
If you only want it in the PDF invoice, you can edit the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php and change the line:
if ($config->get('show_code')) {
to:
if(true) {

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

  • Posts: 64
  • Thank you received: 1
  • Hikashop Business
2 months 1 week ago #334295

Hi Nicolas,

No if ($config->get('show_code')) { in plugins/hikashop/attachinvoice/attachinvoice/invoice.php. Do I have a outdated version?
I think this is the right button in the config? See screenshot.

Regards,
Raoul

Attachments:

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

  • Posts: 73703
  • Thank you received: 11298
  • MODERATOR
2 months 1 week ago #334297

Hi,

Well, in that case, you probably have an old version of the plugin yes.
In that file, you can add that line of code to display the product code:
echo '<br/>'.$product->order_product_code;
That's the line already there by default.
Now I'm not sure what's the status of the code in your version of the plugin, so I can't say where to add it exactly.
Search for order_product_name and add that code after the line with order_product_name in it.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum