Change Translate Product Name in the invoice

  • Posts: 567
  • Thank you received: 11
2 years 11 months ago #340643

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2.34
-- Browser(s) name and version -- : google chrome

Hi, may I know I already use falang, but when print the invoice, the product name still using the default language.

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
2 years 11 months ago #340654

Hi,

The product name of a product in an order is stored in the order in the language in which the customer places his order.
So later on, regardless of the current language of the website, the name displayed will be the one stored in the order and not a dynamically generated name based on the current language.

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

  • Posts: 567
  • Thank you received: 11
2 years 11 months ago #340679

Any ways to change the product name in the invoice?

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
2 years 11 months ago #340685

Hi,

Well, to change the name of the product stored in the order, you can edit the product on the order edit screen and modify the text in the input of the popup.

Now, if you're asking how to dynamically translate the name of the product in the order, it's possible. In the file order / invoice, that you can edit via the menu Display>Views, you can change that code:

<?php echo $product->order_product_name; ?>
to:
<?php echo $class = hikashop_get('class.product');
$data = $class->get($product->product_id);
if(!empty($data->product_name)) { echo $data->product_name; } else {echo $product->order_product_name; } ?>

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

Time to create page: 0.053 seconds
Powered by Kunena Forum