Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 62
  1. #51
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Updating Mod for 150 - Little Problem

    Does this file exist??
    includes/templates/template_default/templates/tpl_modules_recent_products.php

    If I am reading this correctly, the error says that this file cannot be found at that location..

    Quote Originally Posted by ScriptJunkie View Post
    Hmmm....ok...now I'm getting these errors:

    and

    This is the code on line 302 of tpl_product_info_display.php:

    PHP Code:
    <!--bof recent products module-->
       <?php require($template->get_template_dir ('tpl_modules_recent_products.php',DIR_WS_TEMPLATE$current_page_base,'templates') . '/tpl_modules_recent_products.php'); ?>
       <!--eof recent products module-->
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #52

    Default Re: Updating Mod for 150 - Little Problem

    Quote Originally Posted by DivaVocals View Post
    Does this file exist??
    includes/templates/template_default/templates/tpl_modules_recent_products.php

    If I am reading this correctly, the error says that this file cannot be found at that location..
    That's kind of what I thought it was saying also...but then I thought...why would it say that? This is an addon file that would go in custom templates (vs a core file that the addon modified).

    So no, it doesn't exist because when I installed, I installed it into my custom template folder, per the folder structure in the addon's fileset.

    It seems strange to me that an addon would be written to look in template_default rather than in custom_template. But that does appear to be what the error is indicating. A simple and obvious fix is to simply load that file into template_default, but I think the better thing to do is to make sure the code is properly written because putting an addon file in template_default instead of custom_template is incorrect procedure unless you want the addon to work in ALL templates vs. your chosen template.

    However....this was not an issue in the vanilla install. It's only happening in my customized store. Not sure what's causing this issue.
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  3. #53
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Updating Mod for 150 - Little Problem

    Quote Originally Posted by ScriptJunkie View Post
    That's kind of what I thought it was saying also...but then I thought...why would it say that? This is an addon file that would go in custom templates (vs a core file that the addon modified).

    So no, it doesn't exist because when I installed, I installed it into my custom template folder, per the folder structure in the addon's fileset.

    It seems strange to me that an addon would be written to look in template_default rather than in custom_template. But that does appear to be what the error is indicating. A simple and obvious fix is to simply load that file into template_default, but I think the better thing to do is to make sure the code is properly written because putting an addon file in template_default instead of custom_template is incorrect procedure unless you want the addon to work in ALL templates vs. your chosen template.

    However....this was not an issue in the vanilla install. It's only happening in my customized store. Not sure what's causing this issue.
    First thing to do IMHO is to add the file to the default_template folder and see if the error goes away..

    I do not think it's an issue for this file to be in the default_template folder.. It's not a core file and will not be overwritten in an upgrade because of this. (which is the primary purpose of the override system)

    However, I'll leave it to those more knowledgeable than I to weigh in here..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #54

    Default Re: Updating Mod for 150 - Little Problem

    Quote Originally Posted by DivaVocals View Post
    First thing to do IMHO is to add the file to the default_template folder and see if the error goes away..

    I do not think it's an issue for this file to be in the default_template folder.. It's not a core file and will not be overwritten in an upgrade because of this. (which is the primary purpose of the override system)

    However, I'll leave it to those more knowledgeable than I to weigh in here..
    OMG I had the same thought as you, but before I did it, I checked the custom template folder and the file in question simply wasn't there - that's what was causing the error. I have no idea how that happened because I specifically remember uploading that file along with my customized tpl_product_info_display.php file.

    So I uploaded it, and now I get this error:

    PHP Parse error: syntax error, unexpected T_ELSE in /includes/modules/recent_products.php on line 57
    The code for that file, lines 52 - 58 is

    PHP Code:
    $num_products_count = ($recent_products_query == '') ? $recent_products->RecordCount();
      
    // show only when 1 or more
     
    if ($num_products_count 0
      if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0
        
    $col_width floor(100/$num_products_count);
      } else {
        
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS); 
    I just don't understand why these legitimate code errors didn't show up during testing on a vanilla install. If the code is wrong - it's wrong - regardless of which template is being used.

    Is that right?
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

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

    Default Re: Updating Mod for 150 - Little Problem

    Yes, the code you quoted is wrong ... regardless of what template is being used.
    .

    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. #56

    Default Re: Updating Mod for 150 - Little Problem

    Wondering if I need a bracket after this line:

    PHP Code:
    if ($num_products_count SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0
        
    $col_width floor(100/$num_products_count); 

    so that it looks like this:

    PHP Code:
    $num_products_count = ($recent_products_query == '') ? $recent_products->RecordCount();
      
    // show only when 1 or more
     
    if ($num_products_count 0
      if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0
        
    $col_width floor(100/$num_products_count); {
      } else {
        
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS); 
    Last edited by ScriptJunkie; 11 Apr 2012 at 08:03 PM.
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  7. #57

    Default Re: Updating Mod for 150 - Little Problem

    that didn't work.
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  8. #58
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating Mod for 150 - Little Problem

    The semicolon is closing the two IF statements.

    If you want to nest IF statements, and incorporate ELSE statements also, then you'd be better off using full brace structure.
    Code:
    if (condition) 
    {
      if (condition) 
      {
        statement;
      } else {
        statement;
      }
    }
    .

    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.

  9. #59

    Default Re: Updating Mod for 150 - Little Problem

    Quote Originally Posted by DrByte View Post
    The semicolon is closing the two IF statements.

    If you want to nest IF statements, and incorporate ELSE statements also, then you'd be better off using full brace structure.
    Code:
    if (condition) 
    {
      if (condition) 
      {
        statement;
      } else {
        statement;
      }
    }

    Ahhh ok...so this:

    PHP Code:
    $num_products_count = ($recent_products_query == '') ? $recent_products->RecordCount();
      
    // show only when 1 or more
     
    if ($num_products_count 0
      if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0
        
    $col_width floor(100/$num_products_count);
      } else {
        
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS); 
    becomes this?

    PHP Code:
    $num_products_count = ($recent_products_query == '') ? $recent_products->RecordCount();
      
    // show only when 1 or more
      
    if ($num_products_count 0)
    {  
      if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
    {  
        
    $col_width floor(100/$num_products_count);
      } else {
        
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS);
     }

    Edit: Ok, I tried the above but I must have done something wrong, because I'm still getting this error:
    PHP Parse error: syntax error, unexpected T_ELSE in /includes/modules/recent_products.php on line 57
    Last edited by ScriptJunkie; 11 Apr 2012 at 08:57 PM. Reason: provide testing results
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  10. #60
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Updating Mod for 150 - Little Problem

    Hi I have just checked the beta i attached a few posts back and the missing brace is there in the beta, i am guessing that perhaps you may have accidentally removed it, whilst getting rid of my commented out testing code
    This is my "cleaned" version, which hasn't yet been tested, but should be fine as only the extraneous comments have been removed

    Quote Originally Posted by ScriptJunkie View Post
    Unable to compare. I uninstalled the mod from my test store once testing was completed.

    During the initial install on the live store, filezilla kept timing out and disconnecting. So this morning, I did a complete uninstall, reinstall of the mod in case any files were corrupted the first time around.

    Same results. The code in includes/modules/recent_products.php, lines 17-21 is below. I don't know a lot about php code...but I don't see what's wrong with it.

    Code:
    if (RECENT_VIEWED_PRODUCTS_MAXIMUM < 1) 
    	//set the maximum number of recently viewed products here
    	 $maximum_recent = 5;
    	 } else {
    	 $maximum_recent = RECENT_VIEWED_PRODUCTS_MAXIMUM;
    Attached Files Attached Files
    Webzings Design
    Semi retired from Web Design

 

 
Page 6 of 7 FirstFirst ... 4567 LastLast

Similar Threads

  1. v150 Updating GV Admin Edit mod for 1.5?
    By ecclescake in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Mar 2013, 04:25 PM
  2. Checklist for 150 mod upgrades?
    By dw08gm in forum Upgrading to 1.5.x
    Replies: 4
    Last Post: 8 Dec 2011, 03:32 AM
  3. Need expert help updating Optional Insurance Mod for 1.3.8
    By jettrue in forum Upgrading from 1.3.x to 1.3.9
    Replies: 12
    Last Post: 28 Dec 2007, 04:34 PM
  4. Need advice for updating an older shipping by product mod
    By bettysue in forum Addon Shipping Modules
    Replies: 0
    Last Post: 10 Dec 2006, 09:01 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