Post by bobpour » Wed Jun 08, 2011 3:00 am

Hello Ladies and gents,
I’m very new to OpenCart as well as PHP (computer bachelor but hardware :( and now in handbag business ??? !)
I Setup the OC 1.5.0.2 few days back (on localhost, IIS 7 and Vista) and playing around with it. I am coming from .ASP and .ASPX world so the whole thing is very exciting and loved what I learned so far.
I’m setting up the site to sell to our existing customers and our bags are TOP SECRET :joker: (we are selling to stores and not consumer) so I have to block the Anonymous user from accessing part of the site (Entire Product pages or at least some of the categories like New Arrival and…)
I did some research on forum and found few posts for previous versions but can’t get the codes to work on 1.5.0.x
I was wondering if anyone here can guide me to a right direction to How to check to see if the user is logged in, Which files has to be protected and…
Thanks in advance.
Last edited by i2Paq on Wed Jun 08, 2011 3:44 am, edited 1 time in total.
Reason: Please use [version] TAG in subject!

Newbie

Posts

Joined
Sun Jun 05, 2011 1:00 am

Post by bobpour » Mon Jun 13, 2011 4:01 am

I play around with category.tpl and tried using tronics solution from earlier posts.
I got some results (so far…)
I added below code to my category.tpl

Code: Select all

<?php
if (!$this->customer->isLogged() &&  
            (
            $this->url->http('account/login') != $breadcrumbs[2]['href'] 
            && $this->url->http('account/forgotten') != $breadcrumbs[2]['href']
            && $this->url->http('account/create') != $breadcrumbs[2]['href']
            )
) {
    $this->redirect($this->url->http('account/login'));
}
?>
Now if the customer is logged in then they can browse the site and there is no problem
But if they are not logged in then I get a blank screen, I think I am sending the NOT logged customers to a wrong location.
Obviously the code above need to be adjusted I just can’t figure out what part!
Any help/suggestion?

Newbie

Posts

Joined
Sun Jun 05, 2011 1:00 am
Who is online

Users browsing this forum: No registered users and 60 guests