Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26
  1. #21
    Join Date
    Sep 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: My idea for accessing zen cart sessions outside of zen...

    I want "login" to change to "logoff" when a person is logged in, and vice versa. The culprit is likely the session variables, although they should be accessible since the zencart directory is on the same server as the home, about, and contact web pages, which are in the website root.

    I thought the code below should work:

    PHP Code:
                    <?php if ($_SESSION['customer_id']) { ?>
                    <li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Logout</a></li>
                <?php
                      
    } else {
                        if (
    STORE_STATUS == '0') {
                
    ?>
                    <li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Login</a></li>
                <?php } } ?>
    I saw an example with a bunch of zen_href_link references, so I was wondering if those additions to the code are necessary, with ez-pages that link to my "external"(outside zen cart) pages.

    Hopefully this topic is relevant enough - I figured not too many other people would see a reason for this workaround.

    I would move the zen-cart files into the website root, but:
    • I'm not sure if it solves the problem
    • Having all of the zencart files floating in the website root would make the file structure less organized.

  2. #22
    Join Date
    Sep 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: My idea for accessing zen cart sessions outside of zen...

    It might be helpful to note my directory structure.
    Website root > index.php,about/index.php, shop/index.php (and all other zencart files are also in the shop directory here)

  3. #23
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: My idea for accessing zen cart sessions outside of zen...

    Website root > index.php,about/index.php, shop/index.php
    Why do you have other pages at the root?

    Make them ezpages and move your cart to the root - -
    Zen Cart has elementary CMS functionality
    Zen-Venom Get Bitten

  4. #24
    Join Date
    Sep 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: My idea for accessing zen cart sessions outside of zen...

    I want my pages to look exactly as they are, and I don't want my home page to be in "myUrl.com/shop/modulesorsomething//main.php". I want my Home page to be in the root directory, with a products page below it(and the products page is the main zen-cart page).

    I have also read that even ez-pages have session issues - but I'm not sure if this is only the case with external links

  5. #25
    Join Date
    Sep 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: My idea for accessing zen cart sessions outside of zen...

    I also have php in my pages. I'm not sure if I can add them as is with everything parsedcorrectly...and keep the page names as main.php(home), product(index.php), etc.

  6. #26
    Join Date
    Sep 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: My idea for accessing zen cart sessions outside of zen...

    Quote Originally Posted by kobra View Post
    Why do you have other pages at the root?

    Make them ezpages and move your cart to the root - -
    Zen Cart has elementary CMS functionality
    I seem to have created the functionality I addressed above as long as the home(shop/main.php) page is in the same directory as zen-cart(shop/index.php), and I included application_top.php at the top of the pages.

    Am I missing any functionality by not using ezpages?

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Using zen cart sessions outside of zen cart
    By rasher in forum General Questions
    Replies: 0
    Last Post: 29 Jul 2009, 08:22 PM
  2. A pretty weird problem while accessing session outside of zen
    By yellow1912 in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 1 Jul 2009, 02:44 AM
  3. Use Zen Variables outside Zen Cart
    By renkforce in forum General Questions
    Replies: 0
    Last Post: 4 Mar 2009, 07:12 PM
  4. Zen Cart Idea/Question
    By SOCiETi in forum General Questions
    Replies: 0
    Last Post: 28 Aug 2007, 07:56 PM
  5. Replies: 4
    Last Post: 30 Oct 2006, 12:59 PM

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