Results 1 to 5 of 5
  1. #1
    Join Date
    May 2007
    Posts
    6
    Plugin Contributions
    0

    Default Linking into and out of Zen Cart

    My task at hand is to link into our Zen Cart from various web sites and provide a convient way for the shopper to navigate back to the web site they started from.

    I think adding a main menu "Return to..." item which is linked back to the calling web site would work well. The return url and a label would be passed as parameters to the Zen Cart. The "Return" menu item would reference this url.

    I'm new to Zen Cart, so opinions on this approach are appreciated.

    Based on the tutorial at http://www.zen-cart.com/wiki/index.p..._API_Tutorials I think extending the /includes/application_top.php to watch for the return url as a GET parameter is a good place to start. When a return url is detected, a "Return" menu item would be added to the main menu.

    Before I get started on this, I would welcome anyones input on whether there is a simpler way, or on modifications that have already been created that I can use, or advise on the most correct places to code this customization.

  2. #2
    Join Date
    May 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: Linking into and out of Zen Cart

    Here is how I handle returning to a previous web site from Zen Cart;

    In my custom template copy of tpl_header.php, I added the following code to create a new <li> item in the navMain div. It creates a new main menu item which links to the previous web site.

    <?php if ($_GET['return_url']) {
    $_SESSION['return_url'] = $_GET['return_url']; }
    if ($_GET['return_label']){
    $_SESSION['return_label'] = $_GET['return_label']; }
    if ($_SESSION['return_url']) { ?>
    <li><a href="<?php echo $_SESSION['return_url']; ?>">
    <?php echo ($_SESSION['return_label'] ? $_SESSION['return_label'] : 'Return ') ?></a></li>
    <?php }?>

    So - if the cart is called from another web site and adds the parameters return_url and return_label, a new menu item appears on the main menu. Ex:
    ../catalog/index.php?return_url=http://www.somesite.com&return_label=Return to SomeSite

    This approach sets session variables which keep the return link on each page as the user navigates from page to page in the cart.

    Peer review and critique of this code is welcome.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,311
    Plugin Contributions
    125

    Default Re: Linking into and out of Zen Cart

    Another approach would be to open the zen cart in a new window (i.e. use target="_blank" in the URL), and thus avoid this problem entirely.

    Good luck,
    swguy
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    May 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: Linking into and out of Zen Cart

    If you want to add static menu links to your header or footer, there is an FAQ here: https://www.zen-cart.com/tutorials/i...hp?article=234

  5. #5
    Join Date
    Mar 2007
    Location
    Seattle, WA
    Posts
    159
    Plugin Contributions
    0

    Default Re: Linking into and out of Zen Cart

    Quote Originally Posted by somuch View Post
    Here is how I handle returning to a previous web site from Zen Cart;
    This worked wonderfully, it took me a minute to realize that I had to include the return path in the link (you spelled it out, I just didn't see it) but other then that, this is an excellent trick.

    Thanks for the quality post.

 

 

Similar Threads

  1. manually linking a product into my shopping cart
    By JakeAy in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Nov 2007, 04:50 AM
  2. Zen Cart - check out - shipping and billing
    By dubya01 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Aug 2007, 05:26 AM
  3. Linking phpbb to zen cart
    By aunrea in forum General Questions
    Replies: 8
    Last Post: 5 Aug 2007, 12:41 PM
  4. Linking Phpbb to zen cart
    By cymric in forum Basic Configuration
    Replies: 15
    Last Post: 1 Jun 2006, 04:30 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