Skip to content
Advertisement

Display video instead of product thumbnail on WooCommerce archive pages

I’m trying to display video of a WooCommerce product on shop page using Advanced Custom Fields plugin .

I want to create a condition, if a product has a video, then show it instead of woocommerce_template_loop_product_thumbnail.

JavaScript

Am I choosing the correct approach?

Here how it should look like:

enter image description here

Advertisement

Answer

Try the following way using hooks instead of overriding template:

JavaScript

Code goes in functions.php file of your active child theme (or active theme). It should works.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement