Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Location
    Autin, TX
    Posts
    4
    Plugin Contributions
    0

    Default Debugging Mode / Stack Trace / What Files Are Being Included?

    Problem: Trying to figure out how which included file in being used for a certain section in order to override it in a template.

    Bad solution #1: Using grep / built-in search tool to navigate horrible maze of "could-be" locations.

    Bad solution #2: Scour for hours or ask every little question on the forums and wait.

    Is there a way to enable either an application-level or PHP debugging type mode that'll spew the name of each included file to the browser? It's fine if it buggers up the output (running this on a dev server now). I'm just going crazy and spending FAR too much time chasing all of these down. (I'd rather become self-sufficient here.)

    Anybody else feeling this pain / have a solution to this?

    Please help!

    ...Failing that, I specifically seek to:
    1) have product listings (categories) display in manipulatable little divs instead of tables.
    2) modify product pages to my little heart's content
    3) modify cart pages

  2. #2
    Join Date
    Feb 2007
    Location
    Autin, TX
    Posts
    4
    Plugin Contributions
    0

    Default Figured It Out!!!

    As the get_template_dir() function defined in:

    /includes/classes/template_func.php

    is used to figure out which which files override which, I modified this to output (to the screen) the paths of the files which it decides to include, immediately before the file is returned.

    Note: the first commented-out debugging statement comes stock with 1.3.7 and is useless in this regard as it only outputs the inputs of the function, and not the location of the files post-override-rules.


    This saved my sanity and hopefully will save a whole slew of you a ton of time, frustration, and questions:

    1) edit /includes/classes/template_func.php
    2) modify the get_template_dir function to resemble the following:

    PHP Code:
      function get_template_dir($template_code$current_template$current_page$template_dir$debug=false) {
        
    //    echo 'template_default/' . $template_dir . '=' . $template_code;
        
    $sanitydebug=true;
        if (
    $this->file_exists($current_template $current_page$template_code)) {
            if(
    $sanitydebug==true){ echo $current_template $current_page '/' $template_code '<br />'; }
          return 
    $current_template $current_page '/';
        } elseif (
    $this->file_exists(DIR_WS_TEMPLATES 'template_default/' $current_pageereg_replace('/'''$template_code), $debug)) {
            if(
    $sanitydebug==true){ echo DIR_WS_TEMPLATES 'template_default/' $current_page '/' $template_code '<br />'; }
          return 
    DIR_WS_TEMPLATES 'template_default/' $current_page;
        } elseif (
    $this->file_exists($current_template $template_direreg_replace('/'''$template_code), $debug)) {
            if(
    $sanitydebug==true){ echo $current_template $template_dir '/' $template_code '<br />'; }
          return 
    $current_template $template_dir;
        } else {
            if(
    $sanitydebug==true){ echo DIR_WS_TEMPLATES 'template_default/' $template_dir '/' $template_code '<br />'; }
          return 
    DIR_WS_TEMPLATES 'template_default/' $template_dir;
          
    //        return $current_template . $template_dir;
        
    }
      } 
    3) To disable these include messages from being displayed, simply change the $sanitydebug line to say:
    PHP Code:
    $sanitydebug=false

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Debugging Mode / Stack Trace / What Files Are Being Included?

    .

    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.

  4. #4
    Join Date
    Feb 2007
    Location
    Autin, TX
    Posts
    4
    Plugin Contributions
    0

    Default Re: Debugging Mode / Stack Trace / What Files Are Being Included?

    ..........
    Last edited by koax; 1 Mar 2007 at 11:29 PM.

  5. #5
    Join Date
    Feb 2007
    Location
    Autin, TX
    Posts
    4
    Plugin Contributions
    0

    Default Re: Debugging Mode / Stack Trace / What Files Are Being Included?

    Oh yeah, I saw the articles on the

    Awesome! I've seen all of the directory structure articles before, but the PDF of the application flow:
    http://www.zen-cart.com/index.php?ma...78&update_id=2
    (Home :: Downloads :: Troubleshooting Tools :: Zen Cart Program Flow Documentation)

    is extremely useful in understanding what's going on. Along with modifying the get_template_dir function to include a debugging mode is still very useful in figuring out what is happening where. It even showed me that I was unknowingly calling some extraneous modules unnecessarily.

    I'll use this thread to post any more useful tidbits if I find other logical places to enable debuging type info.

    Thank you!

 

 

Similar Threads

  1. (Sitemap) XML files are being served by webserver as type 'text/html'
    By rrdein in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 13 Jan 2015, 03:43 AM
  2. v139g handling charges are not being included in the total
    By greenman161 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 28 Jun 2013, 02:51 PM
  3. What templates are included in install?
    By NaturalEnquirer in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Jan 2009, 08:17 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