[Support request] The videos in the product categories open only for a few seconds and then forwar

Home Forums Support [Support request] The videos in the product categories open only for a few seconds and then forwar

Home Forums Support The videos in the product categories open only for a few seconds and then forwar

  • This topic has 14 replies, 3 voices, and was last updated 2 months ago by David.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1850243
    Ceramica Sud Curlante

    Hi, I created an e-commerce video. I have inserted videos with function LAZY LOAD in the short description, when I click on the video in the product category or home page, the video opens for a few seconds and forwards me directly to the product without showing me the video.

    The product (except button) elements are inside “a” tag (inside clickable link). If you click anywhere on product (except space around button), it is a link into product page. This is default WooCommerce layout – see default WooCommerce theme – https://themes.woocommerce.com/storefront/

    You can switch the theme to default WooCommerce – Storefront – https://wordpress.org/themes/storefront/ and see the result.

    Problem is in the plugin, that “inject” code inside “a” tag link. This is not correct. They must do it outside.

    #1850249
    Leo
    Staff
    Customer Support

    Hi there,

    Just to confirm, are you saying that this issue only occurs with GP Premium activated?

    #1850269
    Ceramica Sud Curlante

    That’s right, I’d like to figure out how to fix the bug.
    try to click on any of the videos on the home page of my site and you will understand.
    The video opens for a few seconds and then I am directed to the article page.
    Thank you very much for your attention.
    Let me know if it is possible to solve my problem.

    #1850273
    Leo
    Staff
    Customer Support

    Gmm I can’t see how GP or GP Premium can cause an issue like this as that is a template from WooCommerce itself.

    Can you disable GP Premium first?

    #1850277
    Leo
    Staff
    Customer Support

    Also, the page you linked in the private info section isn’t using GeneratePress as the theme.

    #1850623
    Ceramica Sud Curlante

    Even setting your theme the problem persists.

    I wanted to know how to fix and what caused the error.

    #1850797
    David
    Staff
    Customer Support

    Hi there,

    thats the default template for woocommerce that wraps the entire content in template product link.
    Try adding this PHP Snippet to close the link just after the image:

    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 15 );
    #2014291
    Ceramica Sud Curlante

    The code has solved the problem, but I find that the title of the product is not clickable, only the photo of the product is clickable.

    #2014447
    David
    Staff
    Customer Support

    Remove that PHP Snippet and try this instead:

    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 ); 
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 9 );
    add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 11 ); 
    #2014954
    Ceramica Sud Curlante

    Bravissimo David …. THANKS REALLY, IT WORKS πŸ™‚ πŸ™‚ πŸ™‚

    #2015032
    David
    Staff
    Customer Support

    Awesome – glad to hear that!

    #2025969
    Ceramica Sud Curlante

    Hi David, is it possible to have both the photo and the title clickable? thank you very much

    #2026167
    David
    Staff
    Customer Support

    Not sure – give this a try instead.

    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 ); 
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 9 );
    add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 11 ); 
    #2028846
    Ceramica Sud Curlante

    – THANKS REALLY, IT WORKS πŸ™‚ πŸ™‚ πŸ™‚

    – The site turned out great!!!

    #2028914
    David
    Staff
    Customer Support

    Awesome – glad to hear that!!

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.