Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to pull category image but where is it?


Guest

Recommended Posts

Hi, I've had to create a new page for a client showing "new collections" i.e the ten latest collections to be added- I've found where the collections live in the database after some searching so have a query that works, as follows:

 

$query = "SELECT * FROM new_categories WHERE parent_id = 0 ORDER BY date_added DESC LIMIT 10"; 

 

All's fine in that it outputs the name and the text description. However this table doesn't seem to store the images associated with the top-level collections, and I can't find any table that does. Anyone know how I can find this? I want to have the image associated with the collection in the table column next to it, for users to see.

 

I saw some category images specified in the categories table, but these are not the same images that are used...

Link to comment
Share on other sites

Hi, I've had to create a new page for a client showing "new collections" i.e the ten latest collections to be added- I've found where the collections live in the database after some searching so have a query that works, as follows:

 

$query = "SELECT * FROM new_categories WHERE parent_id = 0 ORDER BY date_added DESC LIMIT 10"; 

 

All's fine in that it outputs the name and the text description. However this table doesn't seem to store the images associated with the top-level collections, and I can't find any table that does. Anyone know how I can find this? I want to have the image associated with the collection in the table column next to it, for users to see.

 

I saw some category images specified in the categories table, but these are not the same images that are used...

I don't have a table called new_categories nor anything labeled 'collections.' Maybe it's just a terminology thing between us... but, category images are stored in the images directory along with the product images. The name of the image file is in the categories table.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

I don't have a table called new_categories nor anything labeled 'collections.' Maybe it's just a terminology thing between us... but, category images are stored in the images directory along with the product images. The name of the image file is in the categories table.

 

Thanks, I think new_categories was created to replace the old categories table by a previous admin, but it doesn't seem to contain any images itself. This is because we have a container outside of categories called "collections" which holds bundles of categories. I looked in the old categories table and could see that images were specified for Categories but not for the Collections- and in the new_categories table where the Collections are, there isn't an image reference at all.

 

Guess this is the problem with having to try and figure out a system that other people have messed with and left no notes about!!

Link to comment
Share on other sites

Thanks, I think new_categories was created to replace the old categories table by a previous admin, but it doesn't seem to contain any images itself. This is because we have a container outside of categories called "collections" which holds bundles of categories. I looked in the old categories table and could see that images were specified for Categories but not for the Collections- and in the new_categories table where the Collections are, there isn't an image reference at all.

 

Guess this is the problem with having to try and figure out a system that other people have messed with and left no notes about!!

 

Fixed, used:

 

 $title3 = $row["categories_id"];
 $title4 = $row['main_img_ext'];

echo '<img src="category_images/main_' . $title3 .'.'.$title4 . '">';

 

Why there isn't a field simply holding the image name or path is beyond me!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...