I have a Drupal site, but the store is in CS-Cart 2.2.3. I’m trying to pull products from CS-Cart into my Drupal pages using a SQL query, but the product thumbnail image is missing for some products. I can’t figure out how CS-Cart determines where a particular product thumbnail image is stored in the file system. Does anyone where/how the path to the thumbnail image is determined?
Here’s my query:
SELECT<br />
`cscart_products`.`product_id` as ID,<br />
`cscart_product_descriptions`.`product` as TITLE,<br />
`cscart_product_prices`.`price` as PRICE,<br />
`cscart_seo_names`.`name` as PAGE,<br />
`cscart_images`.`image_id` as IMAGE_ID,<br />
`cscart_images`.`image_path` as PATH,<br />
`cscart_categories`.`id_path` as CATEGORY_PATH<br />
FROM `cscart_products` <br />
LEFT JOIN `cscart_product_descriptions`<br />
ON (`cscart_products`.`product_id` = `cscart_product_descriptions`.`product_id`)<br />
LEFT JOIN `cscart_product_prices` <br />
ON (`cscart_products`.`product_id` = `cscart_product_prices`.`product_id`)<br />
LEFT JOIN `cscart_images_links`<br />
ON (`cscart_products`.`product_id` = `cscart_images_links`.`object_id`)<br />
LEFT JOIN `cscart_images` <br />
ON (`cscart_images_links`.`detailed_id` = `cscart_images`.`image_id`)<br />
LEFT JOIN `cscart_seo_names`<br />
ON (`cscart_products`.`product_id` = `cscart_seo_names`.`object_id`)<br />
LEFT JOIN `cscart_products_categories`<br />
ON (`cscart_products`.`product_id` = `cscart_products_categories`.`product_id`)<br />
LEFT JOIN `cscart_categories`<br />
ON (`cscart_products_categories`.`category_id` = `cscart_categories`.`category_id`)<br />
WHERE `cscart_products`.`status` = "A" AND `cscart_products`.`amount` > 0 AND `cscart_images_links`.`object_type` = 'product' AND `cscart_images_links`.`type` = 'M' AND `cscart_seo_names`.`type` = 'p' AND `cscart_products_categories`.`link_type` = 'M'<br />
GROUP BY `cscart_products`.`product_id` <br />
ORDER BY `cscart_products`.`timestamp` DESC<br />
LIMIT 5<br />
<br />