Monday, November 17, 2008

Add videos to VirtueMart products - with the help of AllVideos Plugin!

AllVideos has made it very easy for people since June 2006 ( :D) to add videos in their Joomla! content. So a natural progression to this would be to add videos in e-shops/product pages as well. We all know that VirtueMart is the best e-shop implementation out there.

So how do we enable video playback in VirtueMart, in an easy manner, similar to the AllVideos Plugin? Well... we just enable the use of AllVideos inside VirtueMart! :D

AllVideos has made it very easy for people since June 2006 ( :D) to add videos in their Joomla! content. So a natural progression to this would be to add videos in e-shops/product pages as well. We all know that VirtueMart is the best e-shop implementation out there.

So how do we enable video playback in VirtueMart, in an easy manner, similar to the AllVideos Plugin? Well... we just enable the use of AllVideos inside VirtueMart! :D

Here's the solution to enable the plugin for the "product details" page:

Open up the file administrator/components/com_virtuemart/html/shop.product_details.php and in the end of it, look for:

Code: Select all

/* Finish and Print out the Page */
echo $template;


and add ABOVE this some code. Overall the change is this:

Code: Select all

// start - enable "content type" plugin parsing
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$row->text = $template;
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
$template = $row->text;
// end - enable "content type" plugin parsing

/* Finish and Print out the Page */
echo $template;


This will load the "content type" plugins in VirtueMart. That means that you can use the AllVideos Plugin to add videos in your products (as showcase) and even use the "Tabs & Slides in Content Items" Plugin to display your product's details in Tabs and/or Slides!!

Cool, huh??

2 comments:

Reynold Hugh said...

What a Great Tips about the virtuemart and I will try it for my new projects.
virtuemart Web templates

Vegan Guy said...

Be aware that the current version of virtuemart lets you include mambots without having to change code.

Go to Virutemart Configuration GLOBAL tab. You will see a checkmark "Enable content mambots / plugins in descriptions?"

Just check it and now you can use external mambots (joomla plugins)

...Rowby