Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products not displayed under Category


ryan3

Recommended Posts

Hello all,

 

I'm new to this forum so I would really appreciate for your help in advance.

 

The problem: When clicked on a category, the products under that category would not displayed. Here's the link to that page:

 

http://nguyen-ryan.com/shop/index.php/cPath/33_28

 

However, I would have no problem link directly to a product under that category. Here's the link to the product:

 

http://nguyen-ryan.com/shop/product_info.php/products_id/62

 

The index page also doesn't have a problem showing the products under "New products" or "Best Sellers" section. Here's the link to that page:

 

http://nguyen-ryan.com/shop/index.php

 

 

If I were to search for the above product. The search page wouldn't able to list it. Here's the link to the search page:

 

http://nguyen-ryan.com/shop/advanced_search_result.php?keywords=banana&search=

 

If I were to search for a product that's not in the database (i.e: asdfa). The search page would load properly. Here's the link to the search page:

 

http://nguyen-ryan.com/shop/advanced_search_result.php?keywords=asdfa&search=

 

I'm not sure if it has something to do with the code or the database. The database works fine with version 2.2. I didn't make any modification to the database. Only import the data into the version 2.3.3 database.

 

Please advice how to correct it. Thank you for your time.

 

Ryan

Link to comment
Share on other sites

The pages are not loading completely. This is probably due to a fatal error in your code, probably in includes/product_listing.php. Check your server's PHP error log, or turn on error reporting in your includes/application_top.php to find the problem. You can also try replacing your copy of the product listing with the stock osC version to verify that is where the problem lies.

 

Also what Chris said.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello,

 

Chris: I did set the "Search Engine Safe URL" to false and still doesn't work.

 

Jim: You are absolutely right that there's fatal error with the product_listing.php. I replaced it with the stock one and it worked fine. I still can't figure out what's the problem with the theme version. It worked fine with the demo OsCommerce database. I don't know if you can tell the error from the code but here is the code. Thanks for your help.

 

 

<?php

 

/*

 

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

 

*/

 

 

 

$listing_sql = str_replace('pd.products_name,', 'pd.products_name, pd.products_description, ', $listing_sql);

 

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

$align = 0;

 

?>

 

 

 

 

 

 

 

<div class="contentText contConteiner_listing">

 

 

 

<?php

 

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

 

?>

 

<div>

 

<span class="f_right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>

 

<span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>

 

</div>

 

<br />

 

 

 

<?php

 

}

 

 

 

$prod_list_contents = '<div class="infoBoxContainer">';

 

 

 

if ( !empty($column_list) ) {

 

$prod_list_contents .=' <div class="infoBoxHeading1 padding_pages_2 margin_bottom_1">' .

 

' <table class="table_style productListingHeader1">' .

 

' <tr>' .

 

' <td class="padding0"><b>'.TEXT_SORT_PRODUCTS.' '.TEXT_BY.':</b> ';

 

 

 

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

 

$lc_align = '';

 

 

 

switch ($column_list[$col]) {

 

case 'PRODUCT_LIST_MODEL':

 

$lc_text = TABLE_HEADING_MODEL;

 

$lc_align = '';

 

break;

 

case 'PRODUCT_LIST_NAME':

 

$lc_text = TABLE_HEADING_PRODUCTS;

 

$lc_align = '';

 

break;

 

case 'PRODUCT_LIST_MANUFACTURER':

 

$lc_text = TABLE_HEADING_MANUFACTURER;

 

$lc_align = '';

 

break;

 

case 'PRODUCT_LIST_PRICE':

 

$lc_text = TABLE_HEADING_PRICE;

 

$lc_align = 'right';

 

break;

 

case 'PRODUCT_LIST_QUANTITY':

 

$lc_text = TABLE_HEADING_QUANTITY;

 

$lc_align = 'right';

 

break;

 

case 'PRODUCT_LIST_WEIGHT':

 

$lc_text = TABLE_HEADING_WEIGHT;

 

$lc_align = 'right';

 

break;

 

case 'PRODUCT_LIST_IMAGE':

 

$lc_text = TABLE_HEADING_IMAGE;

 

$lc_align = 'center';

 

break;

 

}

 

 

 

if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

 

$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

 

$prod_list_contents .= ' '.$lc_text.' ' ;

 

}

 

}

 

 

 

 

 

$prod_list_contents .= '</td></tr></table></div>';

 

 

 

}

 

if ($listing_split->number_of_rows > 0) {

 

$rows = 0;

 

$listing_query = tep_db_query($listing_split->sql_query);

 

$counter = 0;

 

$col = 0;

 

$width = floor(100 / $dresscode_grids);

 

$num_products = tep_db_num_rows($listing_query);

 

 

 

while ($listing = tep_db_fetch_array($listing_query)) {

 

$counter++;

 

if (tep_not_null($listing['specials_new_products_price'])) {

 

$products_price = '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>

 

<span>' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';

 

$product['sticker'] = '<span class="product_sticker sticker_onsale_top_left sticker_onsale_display"></span>';

 

} else {

 

$products_price = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));

 

$product['sticker'] = '';

 

}

 

 

 

$products_price = '<span class="new_price">'.$products_price.'</span>';

 

 

 

$product['id'] = $listing['products_id'];

 

$product['name'] = $listing['products_name'];

 

$product['price'] = $products_price;

 

$product['price_special'] = $products_price_special;

 

$product['name_url'] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']);

 

 

 

 

 

/*if product has big img*/

 

$current_product = $product['id'];

 

$products_new_added_big_img_query = tep_db_query("select distinct pi.image, pi.products_id from " . TABLE_PRODUCTS_IMAGES . " pi where pi.products_id = '$current_product' order by pi.id ASC ");

 

$products_new_added_big_img = tep_db_fetch_array($products_new_added_big_img_query);

 

if (tep_not_null($products_new_added_big_img['image'])) {

 

$product['image'] = tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="scale-with-grid"').

 

'<div class="roll_over_img">'.tep_image(DIR_WS_IMAGES . $products_new_added_big_img['image'], $products_new_added_big_img['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="scale-with-grid"').'</div>';

 

}

 

else {

 

$product['image'] = tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="scale-with-grid"');

 

}

 

$product['cart_url'] = tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']);

 

 

 

require(DC_BLOCKS. 'dresscode_model_listing.php');

 

 

 

$prod_list_contents .= '<div class="four columns product_wrapper count_3cols_col_'.$col3.' count_2cols_col_'.$col2.'">'.$dresscode_listing_output.'</div>';

 

$col ++;

 

if (($col >= $dresscode_grids) || ($counter == $num_products)) {

 

while ( $col < $dresscode_grids ) {

 

$col++;

 

}

 

$col = 0;

 

}

 

}

 

$prod_list_contents .= '</div>';

 

echo $prod_list_contents;

 

} else {

 

?>

 

<p class="no_products"><?php echo TEXT_NO_PRODUCTS; ?></p>

 

<?php

 

}

 

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

 

?>

 

 

 

<div class="et_pager">

 

<span><?php echo '<label>'.TEXT_RESULT_PAGE.'</label>' . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>

 

</div>

 

 

 

<?php

 

 

 

}

 

 

 

?>

 

 

 

</div>

Link to comment
Share on other sites

I can't tell just by looking at the code. I would have to have the error message to know where to start looking.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

ps. Also, that is a VERY poorly coded template. I would ask for a refund from whoever you bought it from.

Why do you say that ? what is poorly coded in your opinion ?

it is the responsive dresscode template that is also used by Magento shops

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...