...

View Full Version : syntax error please help!



scott_white85
08-30-2011, 09:34 AM
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']))));

Lamped
08-30-2011, 09:49 AM
$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']));

scott_white85
08-30-2011, 10:36 AM
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
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_WIDTH, SUBCATEGORY_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;
?>

gvre
08-30-2011, 10:48 AM
You should replace

strpos('_', $cPath)
with

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

if (!empty($cPath) && strpos($cPath, '_') !== false)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum