Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    25
    Thanks
    5
    Thanked 0 Times in 0 Posts

    syntax error please help!

    i got this error:

    Parse error: syntax error, unexpected ',' in C:\wamp\www\flotech-latesbackup-Copy\shop\includes\boxes\featured.php on line 37


    this is line 37:

    $new_price = $currencies->display_price($random_product['products_price'], ($random_product['products_tax'], ($random_product['currency_id'], tep_get_tax_rate($random_product['products_tax_class_id']))));

  • #2
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    PHP Code:
    $new_price $currencies->display_price($random_product['products_price'], $random_product['products_tax'], $random_product['currency_id'], tep_get_tax_rate($random_product['products_tax_class_id'])); 
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    25
    Thanks
    5
    Thanked 0 Times in 0 Posts
    hi thanks for your reply.. i tried your code and its working already. but another error comes in..

    Warning: strpos() [function.strpos]: Empty delimiter. in C:\wamp\www\flotech-latesbackup-Copy\shop\index.php on line 386


    this is the line 386 in index.php:

    PHP Code:
    <?php
        
    if (isset($cPath) && strpos('_'$cPath)) {
    // check to see if there are deeper categories within the current category
          
    $category_links array_reverse($cPath_array);
          for(
    $i=0$n=sizeof($category_links); $i<$n$i++) {
            
    $categories_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "'");
            
    $categories tep_db_fetch_array($categories_query);
            if (
    $categories['total'] < 1) {
              
    // do nothing, go through the loop
            
    } else {
              
    $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
              break; 
    // we've found the deepest category the customer is in
            
    }
          }
        } else {
          
    $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$current_category_id "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
        }

        
    $number_of_categories tep_db_num_rows($categories_query);

        
    $rows 0;
        while (
    $categories tep_db_fetch_array($categories_query)) {
          
    $rows++;
          
    $cPath_new tep_get_path($categories['categories_id']);
          
    //$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
                
    $width '225';
                if(
    tep_not_null($categories['categories_image'])) {
              echo 
    '                <td align="center" class="main" width="' $width '" height="100"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '">' tep_image(DIR_WS_IMAGES $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br><strong>&raquo;&nbsp;' $categories['categories_name'] . '</strong></a></div></td>' "\n";
                } else {
              echo 
    '                <td align="left" valign="middle" class="main" width="' $width '" height="50"><div class="jamesbox"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '"><strong>&raquo;&nbsp;' $categories['categories_name'] . '</strong></a></td>' "\n";
                }
          if (((
    $rows MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
            echo 
    '              </tr>' "\n";
            echo 
    '              <tr>' "\n";
          }
        }

    // needed for the new products module shown below
        
    $new_products_category_id $current_category_id;
    ?>

  • #4
    Regular Coder
    Join Date
    May 2011
    Posts
    240
    Thanks
    1
    Thanked 56 Times in 55 Posts
    You should replace
    PHP Code:
    strpos('_'$cPath
    with
    PHP Code:
    strpos($cPath'_'
    Note that strpos may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". I would write
    PHP Code:
    if (!empty($cPath) && strpos($cPath'_') !== false


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •