Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2006
    Location
    Toronto, ON
    Posts
    87
    Plugin Contributions
    0

    Default Add Active Zenid to link

    I'm needing the ability to add a customers current session id to a link. This is a link that I would be placing in the main section of a page, and the dropdown header, so it can't be a complicated sidebox (which I've already come across).

    So far I have a code that looks like this, and as you can tell I'm not the most advanced coder.
    Code:
    <a href=http://store1.salvationarmy.ca,$session>Online Store</a>
    Help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: Add Active Zenid to link

    Why ?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2006
    Location
    Toronto, ON
    Posts
    87
    Plugin Contributions
    0

    Default Re: Add Active Zenid to link

    Well, I've been making great gains integrating the MultiSite Module to create essentially two classes of customers. One group of customers with access to all products, and the other group with only select access to products. This ability will allow us to supply our more official supplies to our locations, without disclosing information on these products to those who may use the information to scam good willed people.

    MultiSite module works for creating two separate sites, but instead I want to integrate it to the point where everyone using the same login screen and the directed accordingly. This way a customer only needs to remember one web address, and we don't have to continually remind our locations of a separate site for internal supplies.

    I posted this in the MultiSite Module Thread, but no one seems to have been able to pass on any hints yet. I thought if I posted it separately I might get someone else to look, that wouldn't normally that support thread.
    Link to posts.

    There is a sidebox with the module that provides this functionality, but I need to take it out of the sidebox to incorporate it into a main page and my dropdown header. When the zenid is able to transfer the shopping cart will be shared, and a customer will only need to login once.

    I've attached a copy of the sidebox with the module, and a crude graph which shows the desired steps/ability.

    I hope I've been able to clearly communicate my idea.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	customer login process.jpg 
Views:	212 
Size:	10.7 KB 
ID:	2530  
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2006
    Location
    Toronto, ON
    Posts
    87
    Plugin Contributions
    0

    Default Re: Add Active Zenid to link

    Any ideas?? I think I've gone a far as I am capable on this, and without any avail yet.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: Add Active Zenid to link

    Using the code you posted, what *does* happen ?
    All you've said is that it's not working.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: Add Active Zenid to link

    What happens if you replace your sidebox code with this:
    Code:
    <?php
    /**
     * This sidebox display the other sites where the customers can buy items from.
     * It allow to do inter-sites orders buy keeping the same session over the other sites.
     * site_links add the zenid to the end of these links and allow to keep the sessions over other sites.
     */
    
      function add_site_link($site_name,$url='',$session=true) {
        global $default_server_name;
        if(($site_name!=$default_server_name)&&("http://$default_server_name"!=$url)) {
          if($url=='') {
            $url = "http://$site_name";
          }
          if($session && zen_not_null(zen_session_id())) {
            if(strpos($url,'?')===false) {
              $separator = '?';
            } else {
              $separator = '&';
            }
            $url .= $separator . zen_session_name() . '=' . zen_session_id();
          }
          return '<a href="'.$url.'">'.$site_name.'</a>';
        }
      }
    
      unset($more_information);
    
    
      //Title of the box (Should be moved to a language file if multi_language site...
        define('BOX_HEADING_SITE_LINKS','Partners');
      //Syntax:
      //add_site_link(DISPLAYED NAME OF THE SITE , URL OF THE SITE);
        $more_information[] = add_site_link('Public Store','http://store1.salvationarmy.ca');
    
    // 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_SITE_LINKS;
        $title_link = false;
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
      }
    
    ?>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jul 2006
    Location
    Toronto, ON
    Posts
    87
    Plugin Contributions
    0

    Default Re: Add Active Zenid to link

    Dr.

    Thanks for your response. I won't lie this issue is really frustrating me. I'm so close to the functionality that I need, but I can't quite seem to grasp it.

    What I'm trying to do is basically take the functionality out of the sidebox, and create the same effect in my dropdown menu, a main section of one page, and other places. For that too happen I need to find a simpler, less complex code for this. For sure it needs to be taken out of the sidebox.

    The first code that I posted was my own attempt at this:
    Code:
    <a href=http://store1.salvationarmy.ca,$session>Online Store</a>
    This is a single line code and it is working as just a straight link. I'm guessing the obvious that I haven't clearly defined where to find the zenid to attach it at the end of the link.

    I posted the previous file attachment to show the original sidebox, that I am trying to modify, I thought it might help. (The original file is working perfectly as intended though).

    I won't lie, it's kind of obvious anyways, but I'm not the most advanced coder on zen.

    Any help is greatly appreciated.

    Thanks.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: Add Active Zenid to link

    Then take *just* the function from the code I posted above, dump it into a new file named /includes/functions/extra_functions/my_functions.php

    Make sure the file contents begins with <?php before the rest of the function definition.

    Then, wherever you want to place your link, just use the call to the function like the sidebox code uses:
    Code:
      echo add_site_link('Public Store','http://store1.salvationarmy.ca');
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jul 2006
    Location
    Toronto, ON
    Posts
    87
    Plugin Contributions
    0

    Default Re: Add Active Zenid to link

    Thanks Doc,

    You are genius. The function that you suggested works excellent!



    I am no longer afraid of the the doctor. (the dentist is a different story)

 

 

Similar Threads

  1. v139h Active Link Issues
    By cracket in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Aug 2012, 02:31 AM
  2. How do I add a "size guide" link to a specific active attribute?
    By rslaing in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 29 Jun 2011, 10:35 AM
  3. #navEZPagesTop active link color
    By HelenSama in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 24 Jun 2009, 09:55 PM
  4. Active Link same as Hover
    By DCDC in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 9 Apr 2009, 04:37 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