Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011
    Location
    Tennessee
    Posts
    377
    Plugin Contributions
    0

    Default How to allow a guest to access only certain products

    My website is a membership store. We require a new user to be confirmed as a member before giving them access to the product pages. However we would like to allow a guest access to the join membership product page only.

    Does anyone have an idea how I could accomplish this?

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: How to allow a guest to access only certain products

    If it's just the product pages, you could use something like:
    Code:
    if(!$_SESSION['customer_id'] && $_GET['products_id'] != 'MEMBERSHIP_PRODUCT_ID') {
        zen_redirect......
    }
    and redirect to the membership page.

    Code:
    if($_SESSION['customers_authorization'] > 0) {
        zen_redirect......
    }
    and redirect to any page that explains they are still not authorized.

    I'd put it in includes/modules/pages/product_info/header_php.php (although it would be wiser to do it using an observer, I know I know...).

  3. #3
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: How to allow a guest to access only certain products

    Quote Originally Posted by balihr View Post
    (although it would be wiser to do it using an observer, I know I know...).
    Hahaha... :) points for acknowledging the wiser option.. :) similar code for both "styles", at least the "action" part.

    Sorry chimed in cuz of the above. :) could reference the last time an observer was created to sort out a similar issue at least that way an example of an observer would be present and the above code could be used "further". :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v139h I Need An Addon That Will Allow Me To Only Sell Certain Products With Other Products
    By CaptainFacePalm in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 14 Feb 2014, 08:29 AM
  2. I need to restrict category access to only certain admins. How can I do this?
    By bparker in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Sep 2009, 05:03 AM
  3. Can I allow certain users to have access to only certain categories?
    By bparker in forum Customization from the Admin
    Replies: 2
    Last Post: 8 Sep 2009, 08:41 PM
  4. allow certain groups to see only certain products.
    By cushietushies in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 3 Oct 2008, 04:33 AM
  5. Only allow certain products to ship California
    By austin881 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Sep 2008, 08:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR