Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I FIXED IT! catagory images not showing? try this...


Trinity

Recommended Posts

AHH, after 4 hours of asking and waiting, I decided to go in and see what was going on.

 

my problem, outlined in the thread below, was that I couldnt get the category images to show in the catalog. they were fine in the admin, and the product listings, but otherwise wouldnt show. I did so much deleting, reuploading and chmod'ing, that I dont even remember what I HAVNT changed. nothing worked... so ...

 

I noticed the <img src="" blah> empty quotes, so I thought at first it was a database prob... dive into the code in the default.php and notice...

 

// check to see if there are deeper categories within the current category

     $category_links = tep_array_reverse($cPath_array);

     for($i=0;$i<sizeof($category_links);$i++) {

       $categories = tep_db_query("select categories_id, categories_name, parent_id from categories where parent_id = '" . $category_links[$i] . "' order by sort_order, categories_name");

       if (tep_db_num_rows($categories) < 1) {

         // do nothing, go through the loop

       } else {

         break; // we've found the deepest category the customer is in

       }

     }

   } else {

     $categories = tep_db_query("select categories_id, categories_name, categories_image, parent_id from categories where parent_id = '" . $current_category_id . "' order by sort_order, categories_name");

   }

 

so, if there is a subcategory nested under it, the image path isnt grabbed.

 

bwaha!

 

change it to this ( notice line 4 )

 

// check to see if there are deeper categories within the current category

     $category_links = tep_array_reverse($cPath_array);

     for($i=0;$i<sizeof($category_links);$i++) {

       $categories = tep_db_query("select categories_id, categories_name, categories_image, parent_id from categories where parent_id = '" . $category_links[$i] . "' order by sort_order, categories_name");

       if (tep_db_num_rows($categories) < 1) {

         // do nothing, go through the loop

       } else {

         break; // we've found the deepest category the customer is in

       }

     }

   } else {

     $categories = tep_db_query("select categories_id, categories_name, categories_image, parent_id from categories where parent_id = '" . $current_category_id . "' order by sort_order, categories_name");

   }

 

everything is tickety boo :P

Link to comment
Share on other sites

AHH, after 4 hours of asking and waiting, I decided to go in and see what was going on.  

 

my problem, outlined in the thread below, was that I couldnt get the category images to show in the catalog.  they were fine in the admin, and the product listings, but otherwise wouldnt show.  I did so much deleting, reuploading and chmod'ing, that I dont even remember what I HAVNT changed.  nothing worked... so ...

 

I noticed the <img src="" blah> empty quotes, so I thought at first it was a database prob...   dive into the code in the default.php and notice...  

 

MM thats blow because mine is different to that already...

 

 

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

$size = sizeof($category_links);

for($i=0; $i<$size; $i++) {

$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 = '" . $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");

if (tep_db_num_rows($categories_query) < 1) {

// do nothing, go through the loop

} else {

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 = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");

}

 

any body able to tell me why mine has c. and cd.before the categories_id etc

 

I am starting to wish I had never started this now!

 

HELP...........please!

Link to comment
Share on other sites

any body able to tell me why mine has c. and cd.before the categories_id etc

 

The "c." and "cd." are MYSQL query "shorthand" for categories categories_description.....the names of the tables that the rows are being called from.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...