PDF Inoice always in specific language

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #303281

-- HikaShop version -- : 4.0.2 Business

Hello!

I have to "force" the invoices to be alwazs in Spanish (due to legal reasons). How can I manage this?

(I can hardcode the wording, but not the product names...)

Thanks!

Juan

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 9 months ago #303286

Hi,

The translated product names are stored with the order when the order is created and the product name at that point comes from the product name in the cart.
So it's not easy. You would have to develop a plugin and implement the onBeforeOrderCreate trigger in it to reload the product names with a MySQL query and change them in $order->products in that trigger.
Otherwise, in the invoice view file, you could also get the product_id from the product object and reload the product name with a MySQL query.
Either way, it's possible but not that easy.

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

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #303334

Thanks! So if somebody buys a product in the Spanish shop, but backend language is english, the invoice is shown in english but product names in Spanish?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 9 months ago #303336

Hi,

The invoice you can generate in the backend will indeed be in English with the product names in Spanish. However, the invoice the customer can print on the frontend will be in Spanish and the product names in Spanish too since he will be logged in with his account in Spanish on your website.

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

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #303435

And in the mails to the customer? Can we setup a language there? Or is it admin language too?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 9 months ago #303438

Hi,

It depends:
- for the order creation notification email, sent when the order is created, when the customer clicks on the finish button of the checkout, everything will be in Spanish.
- for the order status notification email, sent when the order status is changed, if it's the one sent when the payment notification is automatically reeived, then it should also be entirely in the language of the customer (unless there is a problem with the way the payment plugin is coded). However, if it is sent when you change manually the status of the order in the backend, then it will be in your backend language but the product names in the language of the customer.
- for the order notification email, sent when you click on the "email" button of the order details page in the backend, it will be in your backend language but the product names in the language of the customer.
So in most cases, your customers should see everything in the correct language in the emails.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum