- Posts: 6
- Thank you received: 0
Mass Action Update Product with Multiple Pricing Tiers
4 years 6 months ago #340335
by kenryanjr
Mass Action Update Product with Multiple Pricing Tiers was created by kenryanjr
-- 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.
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.
-- 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.
4 years 6 months ago #340348
by nicolas
Replied by nicolas on topic Mass Action Update Product with Multiple Pricing Tiers
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:
And another action "run MySQL query" action with such a query to add a new price:
where xxx is the id of the currency of your prices.
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:
Code:
UPDATE #__hikashop_price as price SET price_value = 5.25 WHERE price_product_id = {product_id} AND price_value = 7;
Code:
INSERT #__hikashop_price (price_product_id, price_value, price_currency_id, price_min_quantity) VALUES ({product_id}, 2.5, xxx, 75);
The following user(s) said Thank You: kenryanjr
Please Log in or Create an account to join the conversation.
4 years 6 months ago - 4 years 6 months ago #340353
by kenryanjr
Replied by kenryanjr on topic Mass Action Update Product with Multiple Pricing Tiers
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?
The first one worked perfect. The second added a ton of rows instead of just one. Any idea why it would have done that?
Code:
INSERT #__hikashop_price (price_product_id, price_value, price_currency_id, price_min_quantity) VALUES (709, 2.5, 2, 75);
Last edit: 4 years 6 months ago by kenryanjr.
Please Log in or Create an account to join the conversation.
4 years 6 months ago - 4 years 6 months ago #340358
by Philip
Replied by Philip on topic Mass Action Update Product with Multiple Pricing Tiers
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
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: 4 years 6 months ago by Philip.
Please Log in or Create an account to join the conversation.
Time to create page: 0.151 seconds