Mass action, add another currency to product

  • Posts: 6
  • Thank you received: 0
2 years 3 months ago #344411

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4

I want to add a new currency (EUR) to the product price, which will be calculated at the exchange rate from the old currency (HRK).

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 3 months ago #344414

Hi,


You can use an action "run MySQL query" on the "product" data with the query below:

INSERT INTO #__hikashop_price (price_value, price_currency_id, price_product_id)
SELECT price_value*xx.x, yyy, price_product_id FROM #__hikashop_price
WHERE price_product_id = {product_id};
Note that you need to replace xx.x by the rate for the conversion and yyy by the id of the EUR currency (it should be 1 normally).
So for example, if 1 HRK = 0.13 EUR, then you would replace xx.x by 0.13

The following user(s) said Thank You: Enc

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

Time to create page: 0.051 seconds
Powered by Kunena Forum