Mass Action Update Product with Multiple Pricing Tiers

  • Posts: 6
  • Thank you received: 0
  • Hikashop Multisite
2 years 8 months ago #340335

-- HikaShop version -- : 4.5.0
-- Joomla version -- : 4.1.0
-- PHP version -- : 7.4.28

I have multiple products that are priced at $7.00 and also $3.00 if the customer purchases 25 or more. I would like to do 2 things.

  • Update just the 7.00 price to 5.25 on all of the products in that category
  • Add an additional price break at 2.50 for 75 or more on all products in that category

I have read how to add to the price or even deduct like this price.price_value/0.75...but it changes both the 3 and 7 dollar pricing structures. How do I just affect the one price value?

Thanks in advance.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 8 months ago #340348

Hi,

You can't use an "update the values" action for that since it will target all the prices of the products.
Instead, you want to use a "run MySQL query" action with such a query to update the price:

UPDATE #__hikashop_price as price SET price_value = 5.25 WHERE price_product_id = {product_id} AND price_value = 7;
And another action "run MySQL query" action with such a query to add a new price:
INSERT #__hikashop_price (price_product_id, price_value, price_currency_id, price_min_quantity) VALUES ({product_id}, 2.5, xxx, 75);
where xxx is the id of the currency of your prices.

The following user(s) said Thank You: kenryanjr

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

  • Posts: 6
  • Thank you received: 0
  • Hikashop Multisite
2 years 8 months ago #340353

Please disregard this post. I didn't set the limitations to 1.

The first one worked perfect. The second added a ton of rows instead of just one. Any idea why it would have done that?

INSERT #__hikashop_price (price_product_id, price_value, price_currency_id, price_min_quantity) VALUES (709, 2.5, 2, 75);

Last edit: 2 years 8 months ago by kenryanjr.

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
2 years 8 months ago #340358

Hello,

You to keep the tag id ("{product_id}"), you just have to replace only the "xxx" and this may work.
Hope this will help you.

Regards

Last edit: 2 years 8 months ago by Philip.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum