Forums / Basic Configuration / Sidebox Visible to Logged in Members Only

Sidebox Visible to Logged in Members Only

Views: 5,966

Results 21 to 33 of 33
19 Dec 2008, 4:58 PM
#21
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Sidebox Visible to Logged in Members Only

Just tried this also and they can still view the page instantly.

19 Dec 2008, 5:07 PM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

Your site is rather confusing ...

What is the exact URL that I should not see when I am not logged in?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Dec 2008, 5:24 PM
#23
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

I have been using ZenCart quite extensively for a few months and decided to try and use it on a customer without products as a CMS site...just as an experiment.

I guess I did use the side login box add-on, but I don't think this makes a difference.

Currently, if you register, you will see a Volunteer Section menu. On this menu is a Member Info link that I have been testing this on. I have gotten the link to be protected because the URL is: http://welslflmilw.com/index.php?main_page=member_info.

The problem that I am running into is that, after registering an account, the menu with the Volunteer Section will appear and allow for members to view immediately...even before being authorized by admin.

20 Dec 2008, 6:39 AM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

Okay I just made an account and I am assuming that I am not yet Authorized on this account ...

Leave it that way for now and let me fool with the settings ...

The code you need is in the functions_prices.php file but I am too tired to work out the code for you without moofing things up tonight ... :blink:

Let me see how this looks sometime tomorrow, if you have not worked out the setting ...

This is not hard, just takes a bit ...

Also, are you allowing the Customer who makes and account but is not authorized yet to see other parts of your site? Or just blocking "some" areas from them until Authorized?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Dec 2008, 7:05 AM
#25
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

I REALLY appreciate all of your help with this! I will leave it alone.

20 Dec 2008, 5:47 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

For the Customer Authorization status, you should be working with the:
CUSTOMERS_APPROVAL_AUTHORIZATION

This is managed with the session variable:
$_SESSION['customers_authorization']

And can be tested with:

// if the customer is not logged on, redirect them to the login page
  if ($_SESSION['customer_id'] <= 0 || $_SESSION['customers_authorization'] > '0') {
    $_SESSION['navigation']->set_snapshot();
    zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
  }

NOTE: you can get a bit fancier and have 1 thing happen for no account and another for have the customers_id but no authorization yet ...

Be sure you are really working with the right setting on the 2 settings for the:
CUSTOMERS_APPROVAL

Customer must be approved to shop
0= Not required
1= Must login to browse
2= May browse but no prices unless logged in
3= Showroom Only

It is recommended that Option 2 be used for the purposes of Spiders if you wish customers to login to see prices.

CUSTOMERS_APPROVAL_AUTHORIZATION

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

It is recommended that Option 2 or 3 be used for the purposes of Spiders

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Dec 2008, 3:45 AM
#27
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

Does this get placed in the includes/modules/pages/CUSTOM PAGE? I got a blank page in this case.

21 Dec 2008, 4:12 AM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

Blank pages are usually the result of a typo ...

Check your code to be sure ...

That code can be added to any header_php.php file where you do not want customers to access unless:

1 Customer is logged in

2 Customer has be Authorized access

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Dec 2008, 4:18 AM
#29
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

I tried it again and got it to work. I authorized yours also so you can see it.

I assume that because they are technically logged in already, but not authorized, they will just be redirected to the "Account" page.

21 Dec 2008, 4:36 AM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

I will make a second account, when I have time, but don't authorize that one so I can see how this is working ...

The idea is ... you need to test this out and remember to use a New Session when testing ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 May 2009, 1:05 AM
#31
jeskremer avatar

jeskremer

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

Ajeh,

I am trying to put this code into the more_information page now instead of the information page, but it doesn't seem to be working correctly.

Here is the code that I have been trying to add:

<?php
/**
 * more_information sidebox - displays list of links to additional pages on the site.  Must separately build those pages' content.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: more_information.php 3464 2006-04-19 00:07:26Z ajeh $
 */

// test if box should display

  unset($more_information);
  
// test if box should display
  $more_information= false;

// test if box should display based on customer is logged in
  if (!$_SESSION['customer_id']) {
    $more_information= false;
  } else {
    $more_information= true;
  }
  
  if ($more_information == true) {

// test if links should display
  if (DEFINE_PAGE_2_STATUS <= 1) {
    $more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_2) . '">' . BOX_INFORMATION_PAGE_2 . '</a>';
  }
  if (DEFINE_PAGE_3_STATUS <= 1) {
    $more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_3) . '">' . BOX_INFORMATION_PAGE_3 . '</a>';
  }
  if (DEFINE_PAGE_4_STATUS <= 1) {
    $more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>';
  }

// insert additional links below to add to the more_information box
// Example:
//    $more_information[] = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">' . 'TESTING' . '</a>';


// only show if links are active
  if (sizeof($more_information) > 0) {
    require($template->get_template_dir('tpl_more_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_more_information.php');

    $title =  BOX_HEADING_MORE_INFORMATION;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  }
?>
17 May 2009, 1:04 PM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sidebox Visible to Logged in Members Only

You are missing the closing bracket } of the IF statement before the closing php tag ?> at the bottom of the file ...

See if adding that helps you out ...

The bottom of the code should look like:

// only show if links are active
  if (sizeof($more_information) > 0) {
    require($template->get_template_dir('tpl_more_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_more_information.php');

    $title =  BOX_HEADING_MORE_INFORMATION;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  }
}
?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Feb 2011, 12:55 AM
#33
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Sidebox Visible to Logged in Members Only

Hi everyone, is there a way to create a sidebox(or a popup) based on validated credentials on a customer login? For example, would it be possible to have a sidebox visible for a birthday greeting or a holiday greeting that is specific to that customer?

The birthday greeting would be dependent of the birthdate and the holiday greeting would be dependent on the customer's country.

Any ideas? Thank you!