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

    Default Custom Include File

    This is the deepest customization I've personally done for zen-cart so I need a little guidance.

    I'm attempting to add a new include file to an existing template and am having difficulty with the template system including the file.

    I have successfully modified the tpl_index_product_list.php file to echo text for the products I want it to display on, and where I want it to display in the product listing, but whenever I switch the echo "Works"; statement with and include('filename_here.php"); it's as if it's ignored.

    Do I need to list the file in filenames.php somewhere/somehow to allow the system to use it?

    P.S. It's a music/drama site so the include file is a media helper file that will read the contents of an mp3 folder as well as a JSON listing of the songs and display a player for the song samples.

    Help appreciated.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,108
    Plugin Contributions
    11

    Default Re: Custom Include File

    Head on over to the plugins and get a copy of lat9's override cheat sheet.

    Invaluable tool when customizing.

  3. #3
    Join Date
    May 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Custom Include File

    Great. Thanks. Downloaded and looked. Not sure it answers my question (or at least overtly does).

    So, if I customize the product listing tpl file with some logic to include a custom .php file on certain conditions, does the new custom .php include file need to be listed in filenames.php, or am I to glean from the cheat sheet it just needs to be placed in the correct location?

  4. #4
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,541
    Plugin Contributions
    19

    Default Re: Custom Include File

    It's not necessary to add it to the filenames.php file (even better if you don't modify the core files).

    Maybe it's because of the location of your filename_here.php file? Try using
    Code:
    include(DIR_FS_CATALOG.'path/to/your/file.php');
    Where exactly did you upload your filename_here.php file? If you uploaded the file to the store root, then it would look like this:
    Code:
    include(DIR_FS_CATALOG.'file.php');
    If it's under includes/modules/ then it can be like this
    Code:
    include(DIR_FS_CATALOG.DIR_WS_MODULES.'file.php');
    OR
    Code:
    include(DIR_FS_CATALOG.'includes/modules/file.php');

  5. #5
    Join Date
    May 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Custom Include File

    Quote Originally Posted by balihr View Post
    It's not necessary to add it to the filenames.php file (even better if you don't modify the core files).

    Maybe it's because of the location of your filename_here.php file? Try using
    Code:
    include(DIR_FS_CATALOG.'path/to/your/file.php');
    Where exactly did you upload your filename_here.php file? If you uploaded the file to the store root, then it would look like this:
    Code:
    include(DIR_FS_CATALOG.'file.php');
    If it's under includes/modules/ then it can be like this
    Code:
    include(DIR_FS_CATALOG.DIR_WS_MODULES.'file.php');
    OR
    Code:
    include(DIR_FS_CATALOG.'includes/modules/file.php');
    That helped... THANK YOU. Working now... tweaking to do!

 

 

Similar Threads

  1. 'include' php file
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Sep 2011, 05:41 PM
  2. Include a custom php file in mainpage.php
    By BeautyHealth.com.cy in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Nov 2010, 02:45 PM
  3. Sidebox include external file?
    By bizshop1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Apr 2009, 10:00 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