Mass action on specific user group

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
1 year 2 months ago #354676

-- HikaShop version -- : 4.7.5
-- Joomla version -- : 3.10.11

Hello,

I am trying to increase the price of all products for a specific user group (Super Users) with 6% but it increases the prices for all usergroups.
At the photo you can see the settings of the "Mass Action" i run. Am i missing something?

Best regards and happy weekend

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 2 months ago #354684

Hi,

The "access level" filter of the "product" data is related to the "access level" of your products, not to the "access level" of the prices of the products.
So with the filter you selected you will target "all the products where the user group "super admin" is selected in the "access level" setting of the product". These are the products that the users from this user group can access on the frontend. It has nothing to do with prices.

Then, there are two cases:
1. You only have one price configured in your products, without "all" selected in the "access level" setting of the price. In that case, being able to split the price into two, one for the users of your specific user group, and another one for everyone else will be difficult. You would need to run several complex queries through your database.
2. Or you already have one price specifically configured for the user group you want to target. In that case, you can run a MySQL query like this:

UPDATE #__hikashop_price set price_value = price_value*1.06 WHERE price_access LIKE '%,xx,%'
where #__ needs to be replaced by the table prefix of the tables, and xx by the id of the user group you want to target.
This will update the price already available for the users of your specific user group.

Finally, if you already have prices in your products, but that the prices are for all the users. Instead of creating different prices, which will be rather difficult ( as I was saying above ), a simpler solution would be to create a discount for that user group via the menu Orders>Discounts. That way, the discount will apply on the fly on the frontend for the users of the user group.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
1 year 2 months ago #354694

Hello,

I tried to execute in PHP myAdmin the next line of code :

UPDATE `x1qp6_hikashop_price` SET `price_value`='price_value*1,06' WHERE `price_access` LIKE '%,8,%';

and got this error message:

MySQL ha dicho: Documentación

#1366 - Incorrect decimal value: 'price_value*1,06' for column `superstar_colores`.`x1qp6_hikashop_price`.`price_value` at row 2

I changed the comma of 1,06 for a point 1.06 but got the sam error message.

Best regards

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 2 months ago #354698

Hi,

The problem is not the comma or point there, but the quote you added around price_value*1,06
This is not valid.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
1 year 2 months ago #354717

Thanks that resolved the problem...

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

Time to create page: 0.068 seconds
Powered by Kunena Forum