Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default single sidebox for external file

    This contribution says if you know php and zen code you can do this. Well, I'm no dummy and definitely know zen cart and have a clue about php but I can't figure out what to do with this file. I assume this is meant to be included in the external file but no matter what I do with it, it doesn't work. Someone got some quick directions? Would be much appreciated.

    I put the file into the modules/sideboxes directory so that (zen cart knowledge) it will work correctly and I then included it in my site page which of course gives that message of headers already output. That makes sense that it wouldn't work correctly this way so what I'm supposed to do with the single sidebox file?
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  2. #2
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: single sidebox for external file

    Have you tried this Contribution, thanks to DrByte?

    Sounds like it is exactly what your looking for

    Absolute

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: single sidebox for external file

    That's what I'm talking about and it has no instructions with it.
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  4. #4
    Join Date
    Jun 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: single sidebox for external file

    Yeah, that is absolutely not an easy to edit mod. I cannot get it working either. And would like to, please help us.

  5. #5
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: single sidebox for external file

    This is a fairly easy mod if you know your way around php. There really isn't much to it.

    Firstly, include the following line at the start of your php file:
    Code:
      require('includes/application_top.php');
    You need to ensure that the path to application top is relative to your file. SO if the new file you are creating is in the same folder as index.php, it is as above, however, if the store is the next level down, then you need to change it to something like "shop/includes/application_top.php"

    Next is the name of the sidebox:
    Code:
    $sidebox_name = 'featured.php';
    
    //which sidebox template to use:
    $column_box_default='tpl_box_default_left.php';
    $column_width = BOX_WIDTH_LEFT;
    
      $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);
      }
    
      require(DIR_WS_INCLUDES . 'application_bottom.php');
    All you need to do here is place this code wherever you wnat it to appear in your page. Replace featured.php for the name of your sidebox file, and your done.

    That is it, nothing else.

    Good luck

    Absolute

  6. #6
    Join Date
    Jun 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: single sidebox for external file

    Yes, that is correct. I did all of that and still got header output errors.

  7. #7
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: single sidebox for external file

    Every header output error is different, so could you be a little more precise? What was the error you received? Did it refer to a line number? What is the offending code on that line?

    Absolute

  8. #8
    Join Date
    Jun 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: single sidebox for external file

    I started over with the tutorial above and got this error:

    http://www.marcusecompressor.com/single_sidebox.php



    From this code:

    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('/home/marcusec/public_html/store/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'); 

    ?>

  9. #9
    Join Date
    Jun 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: single sidebox for external file

    Here is an example of the exact code provided, copied into the store directory. (In the store directory, theoretically it should work perfectly.)


    http://marcusecompressor.com/store/singletest.php

  10. #10
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: single sidebox for external file

    Okay, neither of your files are visible.

    My error was the headers already output- I finally figured out that the application_top.php has to go first in my file. I did get it to work in the store directory.

    If I put it in my root directory, the page redirects, looking for the install files so it really doesn't like any other directory - it looks like it has to go into the store directory. I, however, need it in my root directory. Anyone know anything differently?
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sidebox include external file?
    By bizshop1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Apr 2009, 10:00 PM
  2. One option for single file download, one option for multiple file download
    By digidiva-kathy in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 12 Mar 2008, 06:25 AM
  3. Single Sidebox for External File image problem
    By aunrea in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2007, 09:32 PM
  4. Single Column without sidebox for product info
    By cafe99 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 25 Jan 2007, 08:34 PM
  5. can you help me with php for the "external sidebox" contribution?
    By p m in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 Nov 2006, 05:02 AM

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