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; ?>
  • Did you solve this? I'm looking for the same solution. – Fancyman Dec 27 '18 at 0:45
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
    I have also try this . it working fine in detail page but not in list page – Navin Bhudiya Dec 6 '16 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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