Page 1 of 7 123 ... LastLast
Results 1 to 10 of 68
  1. #1
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Put A Zc Sidebox On A Page Outside Zc?

    Hi,

    I tried searching but could not formulate a productive set of keywords.

    I'd like to put the ZC Featured box on an HTML web page that is outside of my ZC store. The rest of my website is hosted on the same server, in a directory at the same level as my store.

    Anyone recall seeing a discussion about doing this, and what keywords I should try to find it?

    Thanks!

    ---Diana

  2. #2
    Join Date
    Feb 2004
    Location
    Michigan
    Posts
    720
    Plugin Contributions
    0

    Default

    Hi dbrewster,

    I've done this before using an Iframe. Make a new page with just your sidebox on it and then call that page into an Iframe on the html page.

    Just be aware that search engine spiders hate iframes and won't spider their content. I did this for a while when I first started out and then moved everything into Zen Cart. Made life so much easier.

    Connie
    Connie Taylor

  3. #3
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default

    Thanks very much for the tip, Connie.

    (I think your website is beautifully customized,.)

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default

    Here's one approach to do it from .php pages within your own website. (This was built based on a Zen Cart v1.3.0 setup):

    Create a file like this (I called it single_sidebox.php) in the root of your store area (ie: same place as index.php and ipn_main_handler.php etc):
    PHP Code:
    <?php
    /**
     * single_sidebox.php used to display a Zen Cart sidebox on some external resource
     *
     * @package general
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: single_sidebox.php based on index.php 2942 2006-02-02 04:41:23Z drbyte $
     */
    /**
     * Load common library stuff 
     */
      
    require('includes/application_top.php');


     
     
    /**
      *   PLEASE ENTER THE NAME OF THE SIDEBOX YOU WANT TO CALL HERE:
        */
    $sidebox_name 'featured.php';

    //which sidebox template to use:
    $column_box_default='tpl_box_default_left.php';
    $column_width BOX_WIDTH_LEFT;



    /**
     * Load required functions and processing to generate the sidebox:
     */
      
    $language_page_directory DIR_WS_LANGUAGES $_SESSION['language'] . '/';
      
    $box_id zen_get_box_id($sidebox_name);

      if ( 
    file_exists(DIR_WS_MODULES 'sideboxes/' $template_dir '/' $sidebox_name) ) {
        require(
    DIR_WS_MODULES 'sideboxes/' $template_dir '/' $sidebox_name);
      } else {
        require(
    DIR_WS_MODULES 'sideboxes/' $sidebox_name);
      }

    /**
     * Load general code which runs before page closes
     */
      
    require(DIR_WS_INCLUDES 'application_bottom.php'); 

    ?>
    To use, on line 21 change "featured.php" to the name of the sidebox file you want displayed (see /includes/modules/sideboxes for the list).

    Then do a <?php require ('single_sidebox.php'); ?> from the page you want the sidebox to appear on. (Your page will have to be a .php script or the <?php tags will simply display as-is, and not execute anything.)


    UPDATE: This code has been updated and packaged for download in the contributions area:
    http://www.zen-cart.com/index.php?ma...products_id=79
    Last edited by DrByte; 16 Sep 2007 at 12:33 AM.
    .

    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.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default

    Here's another approach, which may work, and was framed prior to Zen Cart v1.3.0:

    http://www.zen-cart.com/forum/showthread.php?t=26952
    Last edited by DrByte; 26 May 2006 at 08:09 PM.
    .

    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
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default

    Dr. Byte,

    Fantastic&#33;

    Why couldn&#39;t this be called as a PHP scripted region within an HTML page?

    ---Diana

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default

    Originally posted by dbrewster@Apr 18 2006, 09:00 AM
    Why couldn&#39;t this be called as a PHP scripted region within an HTML page?
    You need a way to tell your server&#39;s HTML parser to execute the PHP code, rather than simply display it.
    .

    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.

  8. #8
    Join Date
    Feb 2006
    Posts
    5
    Plugin Contributions
    0

    Re: Put A Zc Sidebox On A Page Outside Zc?

    i have done this on one of my pages, however, the links are fine they go to the correct place, but the product image is set from where the single_sidebox.php file is called from, ie a different domain.
    is there a way to hard-code the beginning of the url into the product image so it loads correctly?

    thanks

    rich

  9. #9
    Join Date
    Apr 2006
    Posts
    22
    Plugin Contributions
    0

    Default Re: Put A Zc Sidebox On A Page Outside Zc?

    I tried this method but when i go to the file I get a blank page

    http://www.canadianyouthworker.com/b...le_sidebox.php

  10. #10

    Default Re: Put A Zc Sidebox On A Page Outside Zc?

    Thanks for the code! I have been looking for something like this for awhile.

    Your code works perfectly for all the sideboxes I tested except the shopping_cart.php sidebox. I realize there maybe additional issues with this particular sidebox but i would love to get it to work. Can you think of an easy way to get the shopping cart box to work?

    Thanks again I really appreciate it and let me know if you need more detail.

    - zblofu

 

 
Page 1 of 7 123 ... LastLast

Similar Threads

  1. Can I put sidebox content into an EZ-Page?
    By makenoiz in forum General Questions
    Replies: 1
    Last Post: 8 Feb 2010, 03:10 AM
  2. Sidebox on outside HTML or TPL page?
    By ymbd in forum Basic Configuration
    Replies: 10
    Last Post: 9 Aug 2008, 07:32 PM
  3. Sidebox information runs on outside of sidebox
    By smacko in forum General Questions
    Replies: 0
    Last Post: 1 Jul 2007, 06:54 AM
  4. Sidebox outside ZC
    By Fogie in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 26 Jun 2006, 09:25 PM
  5. put a zc sidebox outside of zc
    By leonardawilson in forum Basic Configuration
    Replies: 1
    Last Post: 26 May 2006, 08:11 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