Forums / All Other Contributions/Addons / Category Specific Access Restriction (CSAR) - [Support Thread]

Category Specific Access Restriction (CSAR) - [Support Thread]

Views: 33,213

Results 81 to 100 of 188
2 Jan 2014, 2:20 AM
#81
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Category Specific Access Restriction (CSAR) - [Support Thread]

zc 1.5.1

When installing "CSAR_install.sql" via the admin "install sql patches"(send) it fails if you have first installed "fec_1-14-2_by Numinixi.
"CSAR_install.sql" Installs just fine on a installation without fec installed.

The error is very generic and I am not getting any debug data in the logs folder.
WARNING: An Error occurred, please refresh the page and try again.

I changed the gID=32 and associated entries from 32 to 36 but no joy....

I'm not a programmer let alone a MySql guy so I just spent 4 hours debugging the problem.
Here's what I found.......................
In the "configuration" tables fec adds a "configuration_tab" column.
Well CSAR_install.sql doesn't take that into account so it just fails with the above generic message.

My 2 questions are:
1:
if I add ,' ' to the end of all three of these INSERT(s) it seems to install the "CSAR_install.sql" OK.....

INSERT INTO configuration VALUES ('', 'Hide Prices for Specific Categories', 'CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY', '0', 'Restrict product price display for specific categories if the customer is not logged in.<br /><br />Enter the categories ID as a comma delimited list - do not use spaces (eg 12,19,45, 7_45).<br /><br />In this example categories 12, 19 and 45 can be restricted (Because category 45 is a subcategory of category 7 you need to enter both 45 and 7_45).<br />', 32, 150, '0001-01-01 00:00:00', now(), NULL, NULL, ' ');
Is that a good workaround?

2:
Other plugin's have already used gID=32 so with
INSERT INTO admin_pages VALUES ('csar_regn', 'BOX_CONFIGURATION_CATEGORY_RESTRICTION', 'FILENAME_CONFIGURATION', 'gID=32', 'catalog', 'Y', @sortorder+1);
I now have two plugins using gID=32. Why doesn't the csar plugin increment to the next highest gID?
Can I change it manually at the above entry and the other 4 places it's referenced?

Keep in mind I have not done the complete install of CSAR so I'm wanting to know if the above will work as it's a very tedious plugin to install over other plugins like fec and easy populate
Thanks

2 Jan 2014, 2:35 AM
#82
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

jt1020

I gave it a quick once over and you are missing this define around line 612
define('TABLE_HEADING_DECRIPTION', 'Description');

Other than that the file looks normal.
In case I missed something compare it the the original.

2 Jan 2014, 11:17 AM
#83
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

...........
2:
Other plugin's have already used gID=32 so with
INSERT INTO admin_pages VALUES ('csar_regn', 'BOX_CONFIGURATION_CATEGORY_RESTRICTION', 'FILENAME_CONFIGURATION', 'gID=32', 'catalog', 'Y', @sortorder+1);
I now have two plugins using gID=32. Why doesn't the csar plugin increment to the next highest gID?
Can I change it manually at the above entry and the other 4 places it's referenced?

Keep in mind I have not done the complete install of CSAR so I'm wanting to know if the above will work as it's a very tedious plugin to install over other plugins like fec and easy populate
Thanks

You are on the right track.

It is a known issue. The gID (as it stands) is hardcoded - it does not automatically increment to the next gID. This will be corrected in the next update of CSAR.

As a workaround (on a fresh install) change gID=32 to something much higher, such as (example) gID=132.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jan 2014, 11:22 AM
#84
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

jt1020

I gave it a quick once over and you are missing this define around line 612
define('TABLE_HEADING_DECRIPTION', 'Description');

Other than that the file looks normal.
In case I missed something compare it the the original.

Thanks for pointing that out. I will have a look at this.

As for installation please bear in mind that CSAR involves a stack of module and template files which need to to be adapted to to what CSAR is all about.

So, the merging and installing process is a bit more complicated than FEC or other mods.

Hope this helps

Cheers / Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jan 2014, 12:11 PM
#85
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

I just got around to playing with this, huge difference from similar or previous versions.

:bigups: from me on this, love it's flexibility!

Awesome job Frank!

2 Jan 2014, 12:55 PM
#86
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

rbarbour:

I just got around to playing with this, huge difference from similar or previous versions.

:bigups: from me on this, love it's flexibility!

Awesome job Frank!

Thanks mate - just have to get around and iron out a few bugs such as the auto increment gID. My time is currently very limited so your input to fix the install-sql file would be much appreciated :smile:

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jan 2014, 1:47 PM
#87
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

frank18:

Thanks mate - just have to get around and iron out a few bugs such as the auto increment gID. My time is currently very limited so your input to fix the install-sql file would be much appreciated :smile:

I did not have any issues but I also did not include the category_specific_access_restriction_admin_page_reg.php, I understand why it is included and it's a great idea. I simply ran the install sql file.

I also used the admin page keys plugin to see if 'gID=32' existed first.

I will take a look and add the sql to auto increment in both category_specific_access_restriction_admin_page_reg.php and install.sql

2 Jan 2014, 4:01 PM
#88
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

Frank18

Yes, Awesome Plugin!!!!

What about this database issue when installing over other plugins?
Is this an acceptable workaround? See red stuff.

1:
If I add , ' ' to the end of all three of these INSERT(s) it seems to install the "CSAR_install.sql" OK when I already have fec installed.....

INSERT INTO configuration VALUES ('', 'Hide Prices for Specific Categories', 'CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY', '0', 'Restrict product price display for specific categories if the customer is not logged in.<br /><br />Enter the categories ID as a comma delimited list - do not use spaces (eg 12,19,45, 7_45).<br /><br />In this example categories 12, 19 and 45 can be restricted (Because category 45 is a subcategory of category 7 you need to enter both 45 and 7_45).<br />', 32, 150, '0001-01-01 00:00:00', now(), NULL, NULL, ' ');

I guess I missed something in the readme/install instructions.. what is the function of "category_specific_access_restriction_admin_page_reg.php" ?

2 Jan 2014, 4:55 PM
#89
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

To Clarify my earlier post.

In the "configuration" tables fec adds a "configuration_tab" column.
CSAR_install.sql doesn't take that into account so it just fails with this generic message.
WARNING: An Error occurred, please refresh the page and try again.

2 Jan 2014, 9:10 PM
#90
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

To Clarify my earlier post.

In the "configuration" tables fec adds a "configuration_tab" column.
CSAR_install.sql doesn't take that into account so it just fails with this generic message.
WARNING: An Error occurred, please refresh the page and try again.

Fec is another third party plugin. CSAR can not take all other contribs into account, it is designed to work with the basic ZC 1.5.1 file system.

If other third party plugins have been previously installed then it is up to the op to make additional changes.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jan 2014, 9:17 PM
#91
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

rbarbour:

I did not have any issues but I also did not include the category_specific_access_restriction_admin_page_reg.php, I understand why it is included and it's a great idea. I simply ran the install sql file.

That file is a modified version of the late Conor's file discussed somewhere in the forums (I am sure you are watching us Conor, we owe you so much!)

rbarbour:

I also used the admin page keys plugin to see if 'gID=32' existed first.

I will take a look and add the sql to auto increment in both category_specific_access_restriction_admin_page_reg.php and install.sql

Much appreciated mate - pls post it here for all to benefit.

Cheers / Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Jan 2014, 3:12 AM
#92
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

Guess I don't understand how to use csar or else I have a bad installation.

Do you use a combination of both the original settings AND csar or just csar?

I need the function of the original 2 & 2 applied to all my products with one category restricted to selected clients.

Customer Shop Status - View Shop and Prices
0= Not required
1= Must login to browse
2= May browse but no prices unless logged in
3= Showroom Only

Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy

3 Jan 2014, 4:26 AM
#93
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

zc 1.5.1
Did a clean install and used the "classic" template and it works as advertised. (almost)
Had a couple issues and maybe this has been reported before but here goes.
1:
I get a white screen in step 7 (have to do a refresh) when logging back in and once logged back in there is no "Category Restriction" entry in the Catalog drop box. log out & log back in but still no entry.
So I then upload the rest of the system files and then I do get the "Category Restriction" entry in the Catalog drop box.

2:
Using option 1 (restrict categories) the first category always displays two "login for price" per the below images.
When you click it (blue link) it goes to the login screen.
[Attachment no longer available][Attachment no longer available]

3 Jan 2014, 10:16 AM
#94
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

Guess I don't understand how to use csar or else I have a bad installation.

Do you use a combination of both the original settings AND csar or just csar?

I need the function of the original 2 & 2 applied to all my products with one category restricted to selected clients.

Customer Shop Status - View Shop and Prices
0= Not required
1= Must login to browse
2= May browse but no prices unless logged in
3= Showroom Only

Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy

This will work just fine. However, if you put the standard settings to 2 & 2 then one part of CSAR becomes obsolete: hiding prices. In your case the visibility of prices is set globally - meaning it applies to ALL categories. None of your items will be displaying prices unless the globally set criteria are being met: 2= May browse but no prices unless logged in AND 2= May browse but no prices unless Authorized

In your case you only set the one single category as being restricted in the CSAR configuration.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Jan 2014, 10:36 AM
#95
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

.......
So I then upload the rest of the system files and then I do get the "Category Restriction" entry in the Catalog drop box.

Many plugin issues are being caused by not uploading ALL files... be that standard ZC files or modified plugin files. Issues also occur by not following the install instructions to the full.

linuxguy2:

2:
Using option 1 (restrict categories) the first category always displays two "login for price" per the below images.
When you click it (blue link) it goes to the login screen.
[Attachment no longer available][Attachment no longer available]

The duplication of "login for price" is a known issue and is being fixed in the upcoming updated version of CSAR.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Jan 2014, 4:54 AM
#96
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

Read the installation instructions carefully. Step 6 is not complete.
Step 6 says to upload category_specific_access_restriction_admin_page_reg.php ONLY.

I'm thinking you must upload ALL the Admin files at step 6.
If you don't there's no way you'll get the menu item (Catalog > Category Restriction) indicated in step 7.

Please correct me if I'm wrong.

Also:
Is there a way to use or duplicate option #2 from the below menu along with csar?

Customer Approval Status - Authorization Pending
Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy.

Thanks.

4 Jan 2014, 8:43 AM
#97
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

linuxguy2:

Read the installation instructions carefully. Step 6 is not complete.
Step 6 says to upload category_specific_access_restriction_admin_page_reg.php ONLY.

I'm thinking you must upload ALL the Admin files at step 6.
If you don't there's no way you'll get the menu item (Catalog > Category Restriction) indicated in step 7.

Please correct me if I'm wrong.

It worked for me (and for many others) on at least 3 sites. You can, however, swap steps 7. and 8. but none of the other steps before step 7.

linuxguy2:

Also:
Is there a way to use or duplicate option #2 from the below menu along with csar?

Customer Approval Status - Authorization Pending
Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy.

Thanks.

Don't quite understand what you mean with this or what you are trying to achieve??

Did you read post #94?

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Jan 2014, 9:20 AM
#98
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

frank18:

Fec is another third party plugin. CSAR can not take all other contribs into account, it is designed to work with the basic ZC 1.5.1 file system.

If other third party plugins have been previously installed then it is up to the op to make additional changes.

hi frank,
although i do not like the way Numinix introduced the configuration tab by default in to their modules, it should not necessarily conflict with installation of other modules.

The problem with your installation sql is,that you do not specify the column names of the table you are inserting data i to.

It would IMHO be better practice to change it to

## Install Category Restriction CSAR for Zen Cart v1.5.x
INSERT INTO `admin_pages` (`page_key`, `language_key`, `main_page`, `page_params`, `menu_key`, `display_on_menu`, `sort_order`)
 VALUES ('1', 'csar_regn');
SELECT @sortorder:=max(sort_order) FROM admin_pages;
INSERT INTO `admin_pages` (`page_key`, `language_key`, `main_page`, `page_params`, `menu_key`, `display_on_menu`, `sort_order`)
 VALUES ('csar_regn', 'BOX_CONFIGURATION_CATEGORY_RESTRICTION', 'FILENAME_CONFIGURATION', 'gID=32', 'catalog', 'Y', @sortorder+1);
INSERT INTO `configuration_group` (`configuration_group_id`, `configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`)
 VALUES ('', 'Category Restriction', 'Configure Category Restriction Settings', '32', '1');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added)
 VALUES ('', 'Hide Prices for Specific Categories', 'CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY', '0', 'Restrict product price display for specific categories if the customer is not logged in.<br /><br />Enter the categories ID as a comma delimited list - do not use spaces (eg 12,19,45, 7_45).<br /><br />In this example categories 12, 19 and 45 can be restricted (Because category 45 is a subcategory of category 7 you need to enter both 45 and 7_45).<br />', 32, 150, '0001-01-01 00:00:00', now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added)
 VALUES ('', 'Set Categories Requiring Customer To Login', 'CATEGORY_RESTRICTION_LOGIN_CATEGORY', '0', 'Specify products of certain categories which can only be accessed by logged in customers.<br /><br />Enter the categories ID as a comma delimited list - do not use spaces (eg 12,19,28).<br /><br />In this example categories 12, 19 and 28 can be restricted.<br />', 32, 160, '0001-01-01 00:00:00', now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added)
 VALUES ('', 'Set Manufacturers Requiring Customer To Login', 'CATEGORY_RESTRICTION_LOGIN_MANUFACTURER', '0', 'Specify manufacturers to be accessed by logged in customers only.<br /><br />Enter the manufacturers ID as a comma delimited list - do not use spaces (eg 1, 5, 6).<br /><br />In this example products of manufacturers IDs 1, 5, 6 can be restricted.<br /><br />The restriction could be to hide prices of certain manufacturers products or it could be used to assign privileged access to manufacturers products.<br />', 32, 165, '0001-01-01 00:00:00', now(), NULL, NULL);
ALTER TABLE `customers` ADD `customers_privileges` INT( 1 ) NOT NULL DEFAULT '0' AFTER `customers_authorization`;

This way sql will know what to insert where, and will give less errors.

4 Jan 2014, 9:52 AM
#99
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

Design75:

hi frank,
although i do not like the way Numinix introduced the configuration tab by default in to their modules, it should not necessarily conflict with installation of other modules.

Absolutely - I agree 100%. In most cases any errors are being caused by careless merging.

Design75:

The problem with your installation sql is,that you do not specify the column names of the table you are inserting data i to.

It would IMHO be better practice to change it to

.... cut ....

> This way sql will know what to insert where, and will give less errors.

Sql knows that anyway whether you specify column names or not. It is important that the sequence is being kept intact. Works every time.

What I need to fix is the autoincrement of the gID which I omitted initially due to extreme time pressure. Without CSAR implemented at a given time one of my stores would have been out of business....

That gID issue is being adressed and fixed in the next update.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Jan 2014, 3:53 PM
#100
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Category Specific Access Restriction (CSAR) - [Support Thread]

frank18:

It worked for me (and for many others) on at least 3 sites. You can, however, swap steps 7. and 8. but none of the other steps before step 7.

So even though I did a fresh zc 1.5.1 install and used the default classic template I still need to merge the files?
Because it was a fresh install with no other plugins I thought I could just install csar over the existing files...

frank18:

Did you read post #94?
Yes, It still did not answer my question.

frank18:

Don't quite understand what you mean with this or what you are trying to achieve??

I need to authorize each customer before they have access to pricing.

That's why I need option #2
Customer Approval Status - Authorization Pending
Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy.