Easily Add YouTube Videos to Magento product page
Create "video" text input attribute.
Now you should find the place in the following file where you want the video to appear: app/design/frontend/yourpackage/yourtheme/template/catalog/product/view.phtml
In this example we will place it under the product name.
<?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; ?>
Written by David Allsop
Related protips
1 Response
You have to insert the code given above just below the following code in view.phtml file. Only then the video will be displayed under the product name.
<div class="product-name">
<h1><?php echo $helper->productAttribute($product, $_product->getName(), 'name') ?></h1>
</div>
For more: http://www.demagento.com/how-to-add-magento-product-video-programmatically/
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Magento
Authors
Related Tags
#magento
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#