Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Link to external Landing Page

    ZC 1.5.1 store is access completely restricted to logged in customers only.

    I have created a external landing page which looks just like my cart pages in the document root of my website where all traffic to "www.somedomain.com" goes. My store is in a subfolder callled "somestore" (not really).

    When I access the external landing page and click the "Log In" link" I have created in the header h t t p s://www.somedomain.com/somestore/index.php?main_page=login" it goes to the log in screen of ZC.
    So far so good..... (Customer decides not to login)

    Now when I click on the "Home" link in the header instead of staying at the cart log in page (like it's supposed to) I would like it to go back to the external landing page.
    What I want is to have the "Home" link switch between logged in (normal operation) and not logged in (Go back to external landing page).
    This probably means adding some code to distinguish between a logged/not logged in.
    Yes, this may be a core file edit which I'm willing to do......

    Maybe there is already a solution for this but I have seen several persons asking for similar functionality but haven't been able to good solution.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Link to external Landing Page

    Something like
    PHP Code:
    if ($_SESSION['customer_id']) { //there will only be a customer_id if logged in
      //link for normal store operation
    } else {
      
    //link back to landing page

    transitioning betwen PHP and HTML as necessary.

    If you post the relevant section of tpl_header.php and the exact links you want (with the actual domain/subdirectory obfuscated if you wish), we can give you more detailed advice.

  3. #3
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Link to external Landing Page

    If you absolutely need an external html page you could modify the index page filters that come with Twitch Wholesale + Attributes...

    Or if you just want logged in/not logged in restrictions the combination of Twitch Wholesale and Twitch Restrict and the default Zen Cart Customer Authorization settings will lock the site down and maintain security without leaving the dynamic pages.

    You can then point robots to follow or not follow the landing pages as you see fit.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  4. #4
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: Link to external Landing Page

    ZC 1.5.1 store access completely restricted to logged in customers only. Customer either gets the external landing page or the internal login page

    twitchtoo,
    That would probably work but I am already way over my limit on plugin's and mods to the template & core. Also the site is in production so I'm very leery about adding more plugin's. I think there is simpler solution.

    gjh42
    I have modified the template and manipulated some core code in this area already.
    Here's the code I'm refering to. Also see attached home01.jpg file
    <body id="loginBody" onload="update_zone(document.create_account); update_zone_shipping(document.create_account);">
    <div id="mainWrapper">
    <!--bof-header logo and navigation display-->
    <div id="headerWrapper">
    <!--bof-navigation display-->
    <div id="navMainWrapper">
    <!-- Added code to display HOME to the left and the LOGIN & Cart to the right -->
    <div id="navMain">
    <ul class="back">
    <li><a href="http://www.somesite.com/store/">Home</a></li>
    EXPLANATION: At the internal login page I want the above link to be "http://www.somesite.com" when NOT logged in and "http://www.somesite.com/store/" when logged in
    </ul>
    </div>
    <div id="navMain">
    <ul class="forward">
    <li><a href="http://www.somesite.com/store/index.php?main_page=login&amp;zenid=1f16ebb439862ddd8dc353179785c57f">Log In</a></li>
    </ul>
    </div>
    <div id="navMainSearch">
    </div>
    <div class="clearBoth"></div>

    Name:  home01.jpg
Views: 231
Size:  21.8 KB

  5. #5
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: Link to external Landing Page

    gjh42

    Guy's, Previously I posted the html output not the code....
    Here it is. Everything else is the same.

    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>
    <div id="headerWrapper">
    <!--bof-navigation display-->
    <div id="navMainWrapper">
    <!-- Added code to display HOME to the left and the LOGIN & Cart the right -->
    <div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    EXPLANATION: At the internal login page I want the above link to be "http://www.somesite.com" when NOT logged in and "http://www.somesite.com/store/" when logged in.
    See html code in previous post.

    </ul>
    </div>
    <div id="navMain">
    <ul class="forward">
    <?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
    <?php
    } else {
    if (STORE_STATUS == '0') {
    ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
    <?php } } ?>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li>
    <!-- Commented out 2 items below to not display standard cart contents & shipping -->
    <!-- <a href="<?php // echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php // echo HEADER_TITLE_CART_CONTENTS; ?></a> --> </li>
    <li> <!-- <a href="<?php // echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php // echo HEADER_TITLE_CHECKOUT; ?></a> --> </li>
    <!-- Added code lines 73 thru 77 to display cart data -->
    <li class="cartCountTotal"> <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"> Check Out:
    <?php $header_cart = $currencies->format($_SESSION['cart']->show_total());
    echo $header_cart; ?></a></li>
    </a> <div class="clearBoth"></div>
    <!-- <br class="clearBoth" /> -->
    <?php }?>
    </ul>
    </div>
    <div id="navMainSearch">
    <?php // require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?>
    </div>
    <div class="clearBoth"></div>
    <!-- <br class="clearBoth" /> -->
    </div>
    <!--eof-navigation display-->

  6. #6
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: Link to external Landing Page

    gjh42 & Twitchtoo
    After thinking about your suggestions I implemented the below and after preliminary testing it seems to work without any side effects.
    Do you see any problems with this solution?

    For those of you who have this same issue with external landing pages I'm pretty sure you could apply some form of this to the original template.

    Thanks, You guys are the best.

    Replaced this:
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php // echo HEADER_TITLE_CATALOG; ?></a></li>

    With this:
    <?php if ($_SESSION['customer_id']) { ?>
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    <?php
    } else {
    if (STORE_STATUS == '0') {
    ?>
    <li><?php echo '<a href="' . HTTP_SERVER . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    <?php } } ?>

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Link to external Landing Page

    Yes, that looks like an effective way to do it. It could be written a bit more elegantly, but will do fine as is.

 

 

Similar Threads

  1. v139h Top Category Link Landing Page
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 5 Nov 2012, 09:45 PM
  2. External Link Opens Internal - Not External - Page
    By missTish! in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Apr 2011, 01:18 AM
  3. Replies: 4
    Last Post: 27 Jan 2010, 09:19 PM
  4. Create link from external page
    By KaworuNagisa in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Oct 2007, 05:49 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