SOLVED - Bulk change for price access level

  • Posts: 25
  • Thank you received: 2
11 years 8 months ago #59125

Hi,

I want to change the price access level from "all" to a custom one for all the products at the same time.
Is there a way to do that?


Joomla! 2.5.6
Hikashop Business 1.6.0
Last edit: 11 years 7 months ago by donig. Reason: SOLVED

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

  • Posts: 127
  • Thank you received: 12
11 years 8 months ago #59127

You could update with SQL either at the mysql command line or via phpmyadmin.

update xxxx_hikashop_product set product_access = "<something>";

That will do for every product including the variants.

It currently carries a default of 'all'.

I'd test it on your dev server first :-).

Tony

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

  • Posts: 25
  • Thank you received: 2
11 years 8 months ago #59132

Thanks, but I want to restrict access only for the price for a certain user group, not to the products.
I tried to change "price_access" from "all" to "registered" but nothing happens...


Joomla! 2.5.6
Hikashop Business 1.6.0

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
11 years 8 months ago #59134

The access levels for prices are stored in the price_access column of the hikashop_price table.
That's the one you should update.

Also, the value should be the id of the user group with a comma before and after. So it should be something like that:
update xxxx_hikashop_price set price_access = ",18,";

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

  • Posts: 25
  • Thank you received: 2
11 years 8 months ago #59140

Still, it has no effect :(
First I wrote right in this form: ,18,
Then I tried this: ",18,";
(I don't know MySQL sintax)


Joomla! 2.5.6
Hikashop Business 1.6.0

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
11 years 8 months ago #59141

What is the query you're using ?

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

  • Posts: 25
  • Thank you received: 2
11 years 8 months ago #59143

I manage to use phpMYAdmin for certain operations but I don't know MySQL.
So, please, be more explicit because I don't know what are you referring at... :P
This is what appears at the top in phpMyAdmin's windows after the change:
ALTERTABLE`xxxx_hikashop_price`CHANGE`price_access``price_access` VARCHAR( 255)CHARACTERSET utf8 COLLATE utf8_general_ci NOTNULL DEFAULT',18,'


Joomla! 2.5.6
Hikashop Business 1.6.0
Last edit: 11 years 7 months ago by donig. Reason: hide shown real prefix tables

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
11 years 8 months ago #59145

You're changing the default value of the column.
That's not what you should do.
Click on "SQL", paste the query I gave you, change the prefix of the table and the id of the user group in the query and run the query.
Here is a tutorial:
community.mybb.com/thread-4720.html

The following user(s) said Thank You: donig

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

  • Posts: 25
  • Thank you received: 2
11 years 8 months ago #59147

It worked like a charm.


Joomla! 2.5.6
Hikashop Business 1.6.0

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

  • Posts: 25
  • Thank you received: 2
11 years 7 months ago #59192

OK, it worked like a charm, indeed :) but later I noticed that I stepped into a problem.
Now, the access is restricted for both unregistered and registered users and remains the same even I change the user group ID back to 29.
I noticed that in the price access level list nothing is checked but only the "custom" radio-button (none of the user groups is selected).


Joomla! 2.5.6
Hikashop Business 1.6.0

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
11 years 7 months ago #59237

That means that you set the id of a user group which doesn't exist in the query you run in phpmyadmin.
Please replace 18 in the query by the id of the user group you want.

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

  • Posts: 25
  • Thank you received: 2
11 years 7 months ago #59266

I used the query that you provided to me (with the correct prefix tables):

update xxxx_hikashop_price set price_access = ",18,";

First, I used 18, after that I tried 29 and again 18.
But the selection remains like in the attached image...


Joomla! 2.5.6
Hikashop Business 1.6.0
Attachments:
Last edit: 11 years 7 months ago by donig. Reason: wrong attached file

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
11 years 7 months ago #59293

I only see that you have the default user groups of Joomla 1.5.
So 18 should be the Registered user group.
So that one should be checked in the price ACL popup when using that query. I don't know why it wouldn't work for you.

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

  • Posts: 25
  • Thank you received: 2
11 years 7 months ago #59299

Well... because it was my fault, I realized after you mentioned about Joomla 1.5.
Now I get it, I wrongly used the user group id 18 instead of 2 (because I have Joomla 2.5)

Thanks very much!


Joomla! 2.5.6
Hikashop Business 1.6.0

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

Time to create page: 0.101 seconds
Powered by Kunena Forum