Home / Forums / Basel support forum / woocommerce hook for featured images on shop / category pages
Home › Forums › Basel support forum › woocommerce hook for featured images on shop / category pages
woocommerce hook for featured images on shop / category pages
- This topic has 12 replies, 2 voices, and was last updated 5 years, 2 months ago by
Artem Temos.
-
AuthorPosts
-
September 8, 2020 at 9:05 am #224499
strandcreativeParticipantWe are using a woocommerce plugin for featured videos instead of featured images. These are’nt showing and the plugin authors are saying for the shop page, theycouldn’t find any hook for the images. This is a theme compatibility issue. Your theme is not using a hook for images. The hook we should be using is woocommerce_product_get_image. Can you help us with this or provide a workaround?
September 8, 2020 at 11:33 am #224553
Artem TemosKeymasterHi,
Try to add the following PHP code snippet to the child theme functions.php file to fix this
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); remove_action( 'woocommerce_before_shop_loop_item_title', 'basel_template_loop_product_thumbnail', 10 );Regards
September 8, 2020 at 11:54 am #224578
strandcreativeParticipantthanks, doing that didn’t change anything but when we changed to number from 10 to 999 it displayed a duplicate of images so that got the video showing but wouldn’t remove the basel images. Any ideas? can i change the numbers on the actions?
Attachments:
You must be logged in to view attached files.September 8, 2020 at 11:55 am #224580
Artem TemosKeymasterPlease, send us your admin and FTP access and switch to default theme temporarily so we can see how the plugin should work.
September 8, 2020 at 12:03 pm #224582
strandcreativeParticipantwe have created staging environtment – https://staging1.rockefellers.co.uk/ so you can do what you want. login details below
September 8, 2020 at 12:32 pm #224600
Artem TemosKeymasterPlease, switch to the default theme and send us a product example where we can see how it should work.
September 8, 2020 at 12:44 pm #224602
strandcreativeParticipantproduct example is – https://staging1.rockefellers.co.uk/product/heart-cut-4-56ct-i-si2-gia-certified/
also switched theme
September 8, 2020 at 12:54 pm #224603
strandcreativeParticipanthttps://staging1.rockefellers.co.uk/shop/ visit this page and you will see the product featured image is blank when it should show preview of the vimeo video like it does on the actual product page
September 8, 2020 at 1:18 pm #224610
Artem TemosKeymasterTry to replace the code with the following one
add_action('init', function() { add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); remove_action( 'woocommerce_before_shop_loop_item_title', 'basel_template_loop_product_thumbnail', 10 ); }, 1000);September 9, 2020 at 8:06 am #224781
strandcreativeParticipantthanks but that doesnt work either. it’s supposed to open up a lightbox with the video on. also when hovering over the product thumbnail it shows the empty image placeholder.
If you check the staging site now i have switched to storefront theme you will see how it should work – https://staging1.rockefellers.co.uk/shop/
the live site doesn’t reflect this – https://rockefellers.co.uk/product-category/diamonds/
September 9, 2020 at 9:31 am #224811
Artem TemosKeymasterAs for the lightbox, it is a separate issue and you need to contact plugin’s support for help.
The hover image function can be disabled in Theme Settings -> Shop.September 9, 2020 at 9:43 am #224814
strandcreativeParticipantthanks it;s working now 🙂
September 9, 2020 at 11:09 am #224855
Artem TemosKeymasterGreat, you are welcome!
-
AuthorPosts
The topic ‘woocommerce hook for featured images on shop / category pages’ is closed to new replies.
- You must be logged in to create new topics. Login / Register