Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default tpl_account_history_info_default.php issues

    Windows 10
    PHP 8.025
    Apache2
    Zencart 1.5.8a (both unmoded and moded)

    While in the process of updating my cart from 1.5.7d to 1.5.8a, I ran into a couple of issues with the subject file.

    First:

    See: tpl_account_history_info_default.php around line 83

    PHP Code:
    <?php
    /**
     * Used to display any downloads associated with the cutomers account
     */
      
    if (DOWNLOAD_ENABLED == 'true') require($template->get_template_dir('tpl_modules_downloads.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_downloads.php');
    ?>
    The if qualifier (DOWNLOAD_ENABLED == 'true') is going to run the require code even if there are no products that are downloadable in the order.

    Another qualifier is necessary to prevent it from processing unnecessarily, and, in my case, it causes horizontal spacing issues between Download and Status History & Comments.

    I wrote the following code to fix it somewhat. It could probably be moved higher up the page where all the foreach code is ran but I'm leaving it where it's at for now...because it works.

    PHP Code:
      $order_includes_downloads = '';
      foreach($order->products as $op) {
        if (isset($op['attributes']) && !empty($op['attributes'])) {
          foreach($op['attributes'] as $attr) {
                    $haystack_1 = nl2br(zen_output_string_protected($attr['option']));    
                    $haystack_2 = nl2br(zen_output_string_protected($attr['value']));
                    $needle = 'Download';
                    if(stripos($haystack_1, $needle) !== false || stripos($haystack_2, $needle) !== false) {
                        $order_includes_downloads = true;
                    }
          }
        }
      }
      if (DOWNLOAD_ENABLED == 'true' && $order_includes_downloads == true) { ?>
        <div id="accountHistoryDownloads" class="back"><?php
          
    require($template->get_template_dir('tpl_modules_downloads.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_downloads.php'); ?>
        </div><br class="clearBoth">
    <?php
      
    }
    ?>
    Second:

    My template would not recognize the constant 'HEADING_TAX' => 'Tax' from the default language file...lang.english.php. I had to put it in languages/english/MY TEMPLAGE/lang.account_history_info.php before it would work. That's a good temp fix but I don't know why or what causes it to do this...all the other "HEADING_" constants are working fine???

    Third:

    The code for creating new address with a new account, adding addresses to the account page, changing a shipping address, and changing a delivery address are nearly identical.

    Wouldn't a function be better suited to handle all of these situations?

    I will work on a function after I finish merging all of my files. I got sidetracked for 3 days messing with the account history and checkout pages because they are so intertwined.

    That's all I can remember from upgrading this file.

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,708
    Plugin Contributions
    123

    Default Re: tpl_account_history_info_default.php issues

    The code you have added to the template is already part of the download module. You don't have to do what you're doing.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default Re: tpl_account_history_info_default.php issues

    Quote Originally Posted by swguy View Post
    The code you have added to the template is already part of the download module. You don't have to do what you're doing.
    Thanks.

    I didn't look at the download module...too focused on fixing the problem I was having.

    The additional <div> and <br> clear both I added are necessary in my mostly tableless template.

    I'm 3 weeks into upgrading my 1.5.7d files to 1.58a...getting tired and frustrated. May be time to take a break.

    I will look at the download module tomorrow and probably modify it instead of this file.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 5 Jan 2015, 11:56 PM
  2. v150 Pulling additional product_order info into tpl_account_history_info_default.php
    By ailtait in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Jan 2013, 12:46 AM
  3. configure.php issues
    By jc8125 in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 1 Jul 2011, 08:15 PM
  4. Configure.php issues
    By megzo487 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 25 May 2010, 06:01 PM
  5. customers.php issues
    By jakumpe in forum General Questions
    Replies: 1
    Last Post: 13 May 2010, 03:04 AM

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