Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

New Product Images Rate Topic   - - - - -

 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 189 posts

Posted 12 February 2019 - 11:15 PM #1

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..



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11363 posts

Posted 13 February 2019 - 01:33 AM #2

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 189 posts

Posted 13 February 2019 - 02:39 AM #3

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.



 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 189 posts

Posted 13 February 2019 - 02:46 AM #4

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. 



 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 189 posts

Posted 15 February 2019 - 01:53 AM #5

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?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11363 posts

Posted 15 February 2019 - 06:15 AM #6

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 189 posts

Posted 17 February 2019 - 11:22 PM #7

Sure, thanks...