New Product Images

Hi - we are running 4.9.2.SP4

It has been a while since we upgraded CS-CART and I noticed that the display for the product images has changed to a more compact view on the general product information page.

We want to be able to add a short caption for each product image that I will display on the front end.... anyone have any recommendations on where I am best to hook into the system to do something like this?

Cheers..

Suggest you use the cscart_common_descriptions table to store your info and then have your addon add that info to product data by using a 'product_data' hook. So essentially you would:

- create an addon

- have it use the 'get_product_data' hook to pull info from the cscart_common_descriptions table and add it to the product data that can then be refrenced from the {$product_data.YOUR_PROPERTY_NAME} variable.

- Utilize a hook to display the info on the product page.

- Utilize one of the 'post' hooks on the admin side to collect your text and store it in the cscart_common_descriptions table.

So you capture/save it in admin, retrieve it in the business rules (PHP code) and display it in the templates.

Ok, thanks - that is helpful.

Trouble is that the new layout doesn't give me anywhere nice to interface with the product images that were uploaded...

Will keep digging.

Best I can think of is adding a section to the "addons" tab and allowing creation / updating meta data there. Initially I was thinking that I might be able to add an icon to the overlay when you rollover an image, but there are no hooks that will let me do this cleanly.

Suggest you use the cscart_common_descriptions table to store your info and then have your addon add that info to product data by using a 'product_data' hook. So essentially you would:

- create an addon

- have it use the 'get_product_data' hook to pull info from the cscart_common_descriptions table and add it to the product data that can then be refrenced from the {$product_data.YOUR_PROPERTY_NAME} variable.

- Utilize a hook to display the info on the product page.

- Utilize one of the 'post' hooks on the admin side to collect your text and store it in the cscart_common_descriptions table.

So you capture/save it in admin, retrieve it in the business rules (PHP code) and display it in the templates.

Hi...

Am I using this table correctly? I have my addon working correctly, but not sure if I am doing it right (as far as cscart_common_descriptions goes).. I ended up using the hook 'get_image_pairs_post' which allows me to insert the caption into the data for an image pair (if one exists)... And of course I am using products.post.php to INSERT/REPLACE when the product is saved

Here are the columns I am populating and what data I am putting into them

option_id -> [detailed_id of image_pair]

description -> "this is an image caption"

lang_code -> "en"

object_holder -> "image_caption"

Only thing I noticed that if a product is cloned, then the captions are not copied across. It appears that CS-CART copies the images of a product when cloning takes place, I was expecting it to just reference the previous image pairs...

Hows the above look to you?

Sounds reasonable but the devil is always in the details....

Not sure on the cloning. You might have to look for a hook in the clone product function and then use it to duplicate your row in common_descriptions. These are all hypothetical's and your mileage may vary.

Sure, thanks...