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

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

Views: 33,211

Results 21 to 40 of 188
7 Jun 2013, 1:23 PM
#21
frank18 avatar

frank18

Deceased

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

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

Don't know where all the </div> tags in your file are coming from. The last lines of this file contained in the plugin package look like this:

<!--bof also purchased products module--> 
<?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?> 
<!--eof also purchased products module--> 
 
<!--bof Form close--> 
</form> 
<!--bof Form close--> 
[B]<?php 
    } // eof CATEGORY_RESTRICTION - OPEN ACCESS 
?> [/B]
</div>

Looks like you have a merging error and missed the code in red. To be on safe side place that code in red before the last </div>

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

7 Jun 2013, 2:18 PM
#22
clausont avatar

clausont

New Zenner

Join Date:
Dec 2012
Posts:
15
Plugin Contributions:
0

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

Hi Frank - we have a fairly new installation of ZC and are using CSAR as we have mostly restricted products but have some products available to the public. I have installed CSAR and merged it all manually. It seems to be working with the exception that I can (when testing) go to the product that is available to the public without logging in (this is the desired effect) and add it to the cart. When I go to checkout, it is still requiring me to log in before checking out. Also, when I go to Customers --> Customers, there is nothing showing "Privileges" on the main page nor when I go into the customer profile. I am sure it is just that I messed up somewhere and missed a file or something, but after carefully double checking that I moved all files to the correct places, I still don't find anything I missed.
I am using ZC 1.5.1 and CSAR v2
Any suggestions you can give would be great.
Thanks!

7 Jun 2013, 2:33 PM
#23
storm007 avatar

storm007

New Zenner

Join Date:
May 2013
Location:
Sheffield, UK
Posts:
11
Plugin Contributions:
0

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

frank18:

Don't know where all the </div> tags in your file are coming from. The last lines of this file contained in the plugin package look like this:

<!--bof also purchased products module--> <?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?> <!--eof also purchased products module--> <!--bof Form close--> </form> <!--bof Form close--> [B]<?php } // eof CATEGORY_RESTRICTION - OPEN ACCESS ?> [/B] </div> ``` > > > Looks like you have a merging error and missed the code in red. To be on safe side place that code in red before the last </div>

Hi Frank,

I inserted the code where you said, but this totally disabled all product info display pages. I have also removed the additional DIV tags.
Do you have any other suggestions?

Kind regards
simon

7 Jun 2013, 2:46 PM
#24
storm007 avatar

storm007

New Zenner

Join Date:
May 2013
Location:
Sheffield, UK
Posts:
11
Plugin Contributions:
0

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

I just don't understand why the page
http://www.neilson-hydraulics.co.uk/store/index.php?main_page=index&cPath=160

looks like this, but before it said login for prices and then re-directed the user to the login page, when logged in they have access to the price of the product.

7 Jun 2013, 9:22 PM
#25
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]

clausont:

...When I go to checkout, it is still requiring me to log in before checking out.

This is standard ZC behaviour

Also, when I go to Customers --> Customers, there is nothing showing "Privileges" on the main page nor when I go into the customer profile. I am sure it is just that I messed up somewhere and missed a file or something, but after carefully double checking that I moved all files to the correct places, I still don't find anything I missed.

Check again your_admin_name/includes/customers.php

There are numerous additions throughout this file.

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

7 Jun 2013, 9:31 PM
#26
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]

storm007:

Hi Frank,

I inserted the code where you said, but this totally disabled all product info display pages. I have also removed the additional DIV tags.
Do you have any other suggestions?

Kind regards
simon

I noted that your site displays SE friendly URI's. So there would have been at least one other modification of this file prior to installation of CSAR....

Suggest you restore the tpl_product_info_display.php from your backup and then do a fresh merge of this file.

It is not uncommon that merging errors occur when other mods have been previously installed. This is true for most modifications of Zen Cart.

Incidentally the CSAR demo site is using the same pure blue free template, same as your store.

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

8 Jun 2013, 8:29 AM
#27
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]

Simon

Suggest you click on one of the test products. Don't click on anything else. Take note of the approximate time when you clicked on the test product. Now download the content of your logs folder and post the debug file that has the corresponding approximate time (should be last file in the store/logs folder).

I also noted that the listing of New Products shows the prices of your test products. Same in the All Products listing. That is a clear sign that you did not upload and/or merge all files contained in the package.

Frank

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

8 Jun 2013, 1:24 PM
#28
clausont avatar

clausont

New Zenner

Join Date:
Dec 2012
Posts:
15
Plugin Contributions:
0

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

Thanks Frank - that worked. Apparently I didn't understand what this plugin does. I was looking for a way to have some products - 1 category - available without having to log in or something like that anyway. Is there a way to emulate that with this plugin?
Thanks

8 Jun 2013, 11:24 PM
#29
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]

clausont:

Thanks Frank - that worked. Apparently I didn't understand what this plugin does. I was looking for a way to have some products - 1 category - available without having to log in or something like that anyway. Is there a way to emulate that with this plugin?
Thanks

CSAR is designed to have most products open to the public (no login required until they want to check out) but restrict some categories/products.

As I see it, you are looking for the reverse way to CSAR: you want all products under lock and key (customer must be logged in to browse and purchase) BUT for one category.

To achieve that you first need to set Customer Shop Status - View Shop and Prices = 1 and then do some coding to excempt just the one category.

So the approach is entirely different to CSAR.

Alternatively, and depending on how many categories you have, you could use CSAR, leave Customer Shop Status - View Shop and Prices = 0 and then restrict all categories execept the one you want to keep open. Tedious but it would work.

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

10 Jun 2013, 1:27 PM
#30
storm007 avatar

storm007

New Zenner

Join Date:
May 2013
Location:
Sheffield, UK
Posts:
11
Plugin Contributions:
0

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

frank18:

Simon

Suggest you click on one of the test products. Don't click on anything else. Take note of the approximate time when you clicked on the test product. Now download the content of your logs folder and post the debug file that has the corresponding approximate time (should be last file in the store/logs folder).

I also noted that the listing of New Products shows the prices of your test products. Same in the All Products listing. That is a clear sign that you did not upload and/or merge all files contained in the package.

Frank

Hi Frank,

Here is the log.

https://www.neilson-hydraulics.co.uk 80.229.41.38 - 2013-06-10 14:16:11 GET /store/ - 200 5728 http://www.neilson-hydraulics.co.uk/store/index.php?main_page=products_all&disp_order=1&page=6 Mozilla/5.0+(Windows+NT+6.1;+rv:21.0)+Gecko/20100101+Firefox/21.0
https://www.neilson-hydraulics.co.uk 80.229.41.38 - 2013-06-10 14:16:23 GET /store/index.php main_page=index&cPath=160 200 5066 http://www.neilson-hydraulics.co.uk/store/ Mozilla/5.0+(Windows+NT+6.1;+rv:21.0)+Gecko/20100101+Firefox/21.0

Also, i have noticed the prices are being displayed on All and New Products. The only files i had to modify were Product_listing.php and tpl_product_info_display.php. Are their more files to modify?

Kind regards
Simon

10 Jun 2013, 9:25 PM
#31
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]

storm007:

Hi Frank,

Here is the log.

www.neilson-hydraulics.co.uk 80.229.41.38 - 2013-06-10 14:16:11 GET /store/ - 200 5728 http://www.neilson-hydraulics.co.uk/store/index.php?main_page=products_all&disp_order=1&page=6 Mozilla/5.0+(Windows+NT+6.1;+rv:21.0)+Gecko/20100101+Firefox/21.0
www.neilson-hydraulics.co.uk 80.229.41.38 - 2013-06-10 14:16:23 GET /store/index.php main_page=index&cPath=160 200 5066 http://www.neilson-hydraulics.co.uk/store/ Mozilla/5.0+(Windows+NT+6.1;+rv:21.0)+Gecko/20100101+Firefox/21.0

Also, i have noticed the prices are being displayed on All and New Products. The only files i had to modify were Product_listing.php and tpl_product_info_display.php. Are their more files to modify?

Kind regards
Simon

I am afraid the links you posted are not the debug log files! :no:

It is also clear that you either did not read the instructions contained in the package or you plainly installed the old version.

Let's back up to square one:

Go to http://www.zen-cart.com/downloads.php?do=file&id=1234 and download the latest version of CSAR.

Unzip the package and READ the readme.html file from start to finish.

Restore your backup and do a fresh merge using the files contained in the package you have just downloaded.

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

11 Jun 2013, 3:41 PM
#32
storm007 avatar

storm007

New Zenner

Join Date:
May 2013
Location:
Sheffield, UK
Posts:
11
Plugin Contributions:
0

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

frank18:

I am afraid the links you posted are not the debug log files! :no:

It is also clear that you either did not read the instructions contained in the package or you plainly installed the old version.

Let's back up to square one:

Go to http://www.zen-cart.com/downloads.php?do=file&id=1234 and download the latest version of CSAR.

Unzip the package and READ the readme.html file from start to finish.

Restore your backup and do a fresh merge using the files contained in the package you have just downloaded.

As you can see, i'm not exactly a whizz at this. Would you recommend uninstalling CSAR, or will it be ok to re-upload the CSAR files?

12 Jun 2013, 7:25 AM
#33
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]

storm007:

As you can see, i'm not exactly a whizz at this. Would you recommend uninstalling CSAR ...

yes, I would

..., or will it be ok to re-upload the CSAR files?

not without indepth knowledge how to merge mods with the existing file system.

Check PM

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

15 Jun 2013, 2:25 AM
#34
clausont avatar

clausont

New Zenner

Join Date:
Dec 2012
Posts:
15
Plugin Contributions:
0

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

Well, I think that may solve the problem, but brings up two others. I had the catalog displaying three columns per row and after merging everything, it is a single row. I'm pretty sure that is because I had another module installed that allowed column display but forgot about it.
The part that I have to ask about is in the instructions:

Please note that you still need to assign special privileges to certain customers you want to allow access to products of categeories / manufacturers you configured in points 2. and 3. in this segment.

To grant access to these customers go to Admin > Customers > Customers and individually open the details of your chosen/approved customers.

In your list of customers you will see a new column on the right hand side headed Privileges. By default the icon is a red cross. You can sort this column to find which customers are 'privileged' or not.

Near the top of each customer's personal details you find a dropdown called Customers Special Privileges Status. The default is 'None'. Set this to 'Has Special Privileges'.

Update the customer file - done

The icon in the customer listing is now changed from a red cross to green indicating that the customer has special privileges.
As I understand it, I would have to go and update all 1,600 customers individually to access the logged in products?
Can you tell me what file to edit to default it to "'Has Special Privileges" rather than "none" or am I mis-understanding this?
Thanks

15 Jun 2013, 7:26 AM
#35
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]

clausont:

Well, I think that may solve the problem, but brings up two others. I had the catalog displaying three columns per row and after merging everything, it is a single row. I'm pretty sure that is because I had another module installed that allowed column display but forgot about it.

Naturally the merging must take individually installed mods into consideration.

The part that I have to ask about is in the instructions:

As I understand it, I would have to go and update all 1,600 customers individually to access the logged in products?
Can you tell me what file to edit to default it to "'Has Special Privileges" rather than "none" or am I mis-understanding this?
Thanks

If you wanted all customers to have special privileges then you really don't need this mod. In Admin > Customers > Customer Approval Status you could set this to 1= Must be Authorized to Browse.

But your equirements may different to here is an SQL statement to run in phpMyAdmin:

Backup your DB !!!

In phpMyAdmin select your DB and click the SQL tab at the top.

Run this statement

UPDATE 'customers' SET 'customers_privileges'= 1

WARNING: This will set privileges of ALL customers to 1, meaning ALL customers will now show 'Has Special Privileges'. New customers will initially still be set to 'none' until you make individual changes to their data.

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

15 Jun 2013, 1:39 PM
#36
clausont avatar

clausont

New Zenner

Join Date:
Dec 2012
Posts:
15
Plugin Contributions:
0

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

Thanks Frank - I appreciate the help here. To be sure I understand correctly before I run the sql statement:
My objective here is as follows. Currently the catalog has only two categories - private and retail. The vast majority of products are private with only a few retail products available to the public and should be available without logging in. All private products must be logged in to purchase or see prices.
Any non-logged in or logged in customer should be able to view retail products and buy retail products, but should not see the prices of the private products if they are not logged in (seeing the products is fine, just not the prices and not be able to add to cart). Any logged in customer should be able to see and purchase any product regardless of which category.
Am I on the right track with the customer privileges? It sounds like it, but just want to confirm first.

15 Jun 2013, 1:57 PM
#37
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]

clausont:

............Am I on the right track with the customer privileges? It sounds like it, but just want to confirm first.

Yes, you are on the right track!

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

16 Jun 2013, 10:00 AM
#38
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]

I have just completed an installation of CSAR for a client and I am pleased to report that the mod CEON URI Mapping has no bearing on the functionality of CSAR 2.0

In other words, if you are hesitating to install CSAR 2.0 because you fear it may not work with CEON URI Mapping, then just go ahead and install CSAR as the two mods happily live side by side, neither of them interfering with the other. :clap:

Frank

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

16 Jun 2013, 10:08 PM
#39
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]

Update to v2.0

To avoid having to enter the master categories ID and the corresponding full cPath (eg 4_12_100) in admin, open your file

includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php

and find

/** 
* CATEGORY_RESTRICTION - we are hiding prices for specific categories only 
 */ 
  if (!$_SESSION['customer_id'] && in_array($cPath,explode(',', CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY)) ) { 
     $hideprice = 'true';  
     } else { 
     $hideprice = 'false'; 
  } 
?>

replace with

/** 
* CATEGORY_RESTRICTION - we are hiding prices for specific master categories only 
 */ 
  if (!$_SESSION['customer_id'] && in_array($result->fields['master_categories_id'],explode(',', CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY)) ) { 
     $hideprice = 'true';  
     } else { 
     $hideprice = 'false'; 
  } 
?>

This will be reflected in the next update of this mod.

Frank

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

19 Jun 2013, 8:41 AM
#40
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]

Update to v2.0

In product listings (all, new, featured etc) the 'Login for price' text does not link to the login page.

To fix this and make 'Login for price' in the listings 'clickable' (= directing to the login page) open your modified file

**includes/functions/functions_prices.php **

and find the chunk of code (around line 152):

// bof: CATEGORY_RESTRICTION - Login for Price

.... code ...

// eof: CATEGORY_RESTRICTION - Login for Price

now replace the lot with this piece of code:

// bof: CATEGORY_RESTRICTION - Login for Price
    $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'";
    $chk_category = $db->Execute($chk_category_sql);
    if ($_SESSION['customer_id'] ==0 && in_array($chk_category->fields['master_categories_id'],explode(',', CATEGORY_RESTRICTION_HIDEPRICE_CATEGORY)) ) {
      $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';
      return $login_for_price;
    }
// eof: CATEGORY_RESTRICTION - Login for Price

This fix will be incorporated in the next update of this mod.

Happy restricting :smile:

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.