3

I want to get product video in product list page(category page) for that i am trying following code . but i am getting blank values. my code is:

$_product->getVideo();

Please guide me for get you tube video url.

I tried code but that works in product listing page but not worked in product details page.

Code what i have tried :

<?php if($_product->getVideo()): ?>`

            <iframe width="560" height="315" src="http://www.youtube.com/embed/<?php echo $_product->getVideo() ?>" frameborder="0" allowfullscreen></iframe>

        <?php endif; ?>
1
  • Did you solve this? I'm looking for the same solution.
    – Fancyman
    Dec 27, 2018 at 0:45

1 Answer 1

1

Try this--

<?php if($_product->getVideo()): ?>`

        <iframe width="560" height="315" src="http://www.youtube.com/embed/<?php echo $_product->getVideo() ?>" frameborder="0" allowfullscreen></iframe>

    <?php endif; ?>
1
  • 1
    I have also try this . it working fine in detail page but not in list page Dec 6, 2016 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.