Results 1 to 10 of 62

Hybrid View

  1. #1

    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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,451
    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.

  3. #3

    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