Home Forums Basel support forum woocommerce hook for featured images on shop / category pages

woocommerce hook for featured images on shop / category pages

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #224499

    strandcreative
    Participant

    We 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?

    #224553

    Artem Temos
    Keymaster

    Hi,

    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

    #224578

    strandcreative
    Participant

    thanks, 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.
    #224580

    Artem Temos
    Keymaster

    Please, send us your admin and FTP access and switch to default theme temporarily so we can see how the plugin should work.

    #224582

    strandcreative
    Participant

    we have created staging environtment – https://staging1.rockefellers.co.uk/ so you can do what you want. login details below

    #224600

    Artem Temos
    Keymaster

    Please, switch to the default theme and send us a product example where we can see how it should work.

    #224602

    strandcreative
    Participant
    #224603

    strandcreative
    Participant

    https://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

    #224610

    Artem Temos
    Keymaster

    Try 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);
    #224781

    strandcreative
    Participant

    thanks 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/

    #224811

    Artem Temos
    Keymaster

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

    #224814

    strandcreative
    Participant

    thanks it;s working now 🙂

    #224855

    Artem Temos
    Keymaster

    Great, you are welcome!

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘woocommerce hook for featured images on shop / category pages’ is closed to new replies.