News:

Looking for documentation? Take a look on our wiki

Main Menu

Videos Instead of Product Images

Started by ViceMart, February 15, 2013, 21:49:12 PM

Previous topic - Next topic

ViceMart

Hello,

I'm on Joomla 2.5.9, Virtuemart 2.0.18a. My shop sells videos that can be downloaded.

VM2 has product images on the product details page, a popup from the product details page, category browse (thumbnails) and search results (thumbnails).

Can anyone suggest an extension, component or plug for VM2 that would easily allow me to show sample product videos instead of these product images? Preferablly I would like HTML5, but FLV or MP4 players would also work.

Or if anyone has updated the VM2 product details page to show a video instead of a product image, could you post your code here?

My videos all have the same naming convention as the product images, except the extension is a video extension, and the videos are in the same directory as the product images, so I would think there would be a simple coding solution or plugin.

Thanks for any advice!

GJC Web Design

To actually replace the html returned in the product object $this->product->images looks very complex....

would it not be simpler just to replace the call in

components/com_virtuemart/views/productdetails/tmpl/default_images.php

to something like (say use the product title as the video name)

echo 'path to image/'.$this->product->title.'.mp4';

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ViceMart

#2
Thanks for the reply!

And that's probably very good advice.
I'm more of a video tech rather than a programmer, so I'm struggling to get the code working. I tried more literally as,

echo 'images/stories/virtuemart/product/'.$this->product->title.'.mp4';

or

echo ('images/stories/virtuemart/product/').$this->product->title.'.mp4';

but that just printed the text "'images/stories/virtuemart/product/.mp4" where the main image would be on the product details page.

I tried looking at plugins, but all of the plugins I found are based on Flash Video and since flv is losing support by Apple and Android, I'd rather make an html5 call such as

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
</video>

but I'm really struggling with how to replace the main-image call in default_images.php with something like the above.

So let's say the path to my images is:

images/stories/virtuemart/product/

And let's say that in the /product/ directory I have multiple files for each product, all with the same name, just different extensions, like this:

1234.jpg
1234.mp4
1234.flv
1234.ogg

3456.jpg
3456.mp4
3456.flv
3456.ogg

Now building on your excellent advice to replace the call in default_images.php, I'm assuming I should replace this existing code:

<div class="main-image">

   <?php
      echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
   ?>

    <div class="clear"></div>
</div>

with something new that would call the video, using my directory and file naming convention. Can anyone guide me on what that should look like?

If I could just get it to call one video file to replace the product image, I think I can build on that to make any modifications, I'm just struggling with that first step.

Thanks for any help!

GJC Web Design



<div class="main-image">

   <video width="320" height="240" controls>
  <source src="<?php echo 'images/stories/virtuemart/product/'.$this->product->title  ?>.mp4" type="video/mp4">
  <source src="<?php echo 'images/stories/virtuemart/product/'.$this->product->title  ?>.ogg" type="video/ogg">
</video>

    <div class="clear"></div>
</div>




GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation