Results 1 to 10 of 62

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    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.

  2. #2

    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

  3. #3
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    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.

  4. #4

    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

  5. #5

    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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    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.

  7. #7

    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

 

 

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

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