Jump to content

youtube video in product page (Assign diffrent video for each product)


vivek tripathi

Recommended Posts

On the continious increasing demand of prestashop users on forum. I have created productvideo module

This module Let's you add youtube presentation (or other link) for your products.
With this module you can add a videos embed code or link to your products,
it provide facility to add diffrent video for each product
the video will be displayed in the extra tab name product video on the product page (next to more info tab
).
Main usage is to add Youtube presentations for your products.

Please download attached zip file for complete module file
tested on prestashop 1.4+

productvideos.zip

  • Like 7
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 2 weeks later...

http://www.rc-car.nl...he-car-kit.html

 

see

 

Voer een query uit op de rc-carnl_ps1 database. CREATE TABLE IF NOT EXISTS `PREFIX_product_videos` ( `id` int(10) NOT NULL AUTO_INCREMENT, `product_id` VARCHAR(10) , `product_name` VARCHAR(255) , `video` VARCHAR(1000) , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

 

Your query did not return any results. (0.0002 seconden)
Link to comment
Share on other sites

how can i add this one ?

http://youtu.be/UwW7t25Uu48

 

all what i do, nothing happend.

the link <p><iframe src="http://www.youtube.com/embed/x5ranQfCxzg" frameborder="0" width="520" height="390"></iframe></p>

works great.

Click SHARE on the bottom of the video and the after a the windows expands, there is a "incorporate" (mine is in portuguese so i don´t know how it appears in english but it must be something like that.

 

embeded.jpg

Link to comment
Share on other sites

  • 1 month later...

I have installed and embed as a test i get the following error at the top of product pages when product video tabbed is clicked on Warning: include_once() [function.include-once]: open_basedir restriction in effect. File(../../classes/Product.php) is not within the allowed path(s): (/home/ladyredo:/usr/lib/php:/usr/local/lib/php:/tmp) in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

 

Warning: include_once(../../classes/Product.php) [function.include-once]: failed to open stream: Operation not permitted in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

 

Warning: include_once() [function.include]: Failed opening '../../classes/Product.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

Home>French Maid>Maid 1

how can i fix this??

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
  • 3 weeks later...

Can anyone tell me if this module should work with PS 1.4.7.3?

 

After I install I get php warnings everywhere. I get these at the module overview:

 

Warning: include_once(../../classes/Product.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\prestashop2\modules\productvideos\productvideos.php on line 12

Warning: include_once() [function.include]: Failed opening '../../classes/Product.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\prestashop2\modules\productvideos\productvideos.php on line 12

Link to comment
Share on other sites

  • 1 month later...

I have installed and embed as a test i get the following error at the top of product pages when product video tabbed is clicked on Warning: include_once() [function.include-once]: open_basedir restriction in effect. File(../../classes/Product.php) is not within the allowed path(s): (/home/ladyredo:/usr/lib/php:/usr/local/lib/php:/tmp) in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

 

Warning: include_once(../../classes/Product.php) [function.include-once]: failed to open stream: Operation not permitted in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

 

Warning: include_once() [function.include]: Failed opening '../../classes/Product.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/ladyredo/public_html/modules/productvideos/productvideos.php on line 12

 

Home>French Maid>Maid 1

 

 

 

how can i fix this??

 

Hello,

 

I had the same problem and I more or less fixed it. You should check your file structure and understnad as the problem is with the path. If you have the basic prestashop file structure you should change the path in the line 12, this should be the code:

 

 

include_once 'classes/Product.php';

 

Ii'm using prestashop 1.4.8.2, so I don't know how this works exactly in other versions. At least this change took all the errors away. I hope this is helpful.

 

Greetings,

 

Dani

Link to comment
Share on other sites

Hello,

I made some fixes to vivek tripathi's module to run it with 1.4.8.

You can download modified version here (link was removed, follow this post, there is a more up to date link)

 

I took prestashop default configuration language for the customer language, I should have taken guest language but it's a 30 seconds fix...

 

Good install

Edited by math_php (see edit history)
  • Like 3
Link to comment
Share on other sites

Hello,

I made some fixes to vivek tripathi's module to run it with 1.4.8.

You can download modified version here http://www.file2data...oductvideos.zip

 

I took prestashop default configuration language for the customer language, I should have taken guest language but it's a 30 seconds fix...

 

Good install

 

Hey!!! Thanks!!!

 

It seems to work perfectly!!! Thanks man!!! If any bug I let you know.

 

Thanks AGAIN math_php

Link to comment
Share on other sites

Thanks for the great module.

 

I want to add the text "No Video Available" if I do not have a video connected to the product. Does anyone know how and where in the code I can insert this?

 

Hi,

 

Just create an if statement. So before the code itself... {If}opens the code for the video to be displayed.{else}(Use PS code)Display=l s={'No videos available'}{/if}

 

After just play with CSS to place it and done. Thats how I did it!

Link to comment
Share on other sites

  • 1 month later...

pretty well done Module !!! so very simple to use !!

 

What do i need to write in the code to center it ?

 

<p><iframe src="http://www.youtube.com/embed/oWsbQxkec1s" frameborder="0" width="560" height="315"></iframe></p>

 

http://www.export-asia.com/android-tablet-pc-wholesale/620--hot-7-tablet-800mhz-256mb-2gb-hdd-wifi-android-23-two-point-touch-flash-101-with-good-battery.html

 

We are Electronics wholesale company with european management. If any good suggestions for integrating functions let me know

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi,

 

After 0 request, I decided, alone and with no more cookies, that you needed this module to work with the new and awsome Prestashop 1.5

 

Then you can try this attached one.

 

Bonjour,

Ce module n'affiche pas de produits dans le listing en backoffice sur la version 1.5

 

Excellent module!! Thank you very much!!!!

 

But there is an error in productvideos.php, line 139:

$sql = 'SELECT id_product, name FROM '._DB_PREFIX_.' product_lang where id_lang='.$id_lang;

It should be:

$sql = 'SELECT id_product, name FROM '._DB_PREFIX_.'product_lang where id_lang='.$id_lang;

 

The difference is a blank space after '._DB_PREFIX_.', that causes an error on the sql query.

 

Best regards

Edited by trinkinho (see edit history)
  • Like 1
Link to comment
Share on other sites

 

The difference is a blank space after '._DB_PREFIX_.', that causes an error on the sql query.

 

 

Well done,I will fix it.

And do you know why it was working for me ? :);)

 

Because I had no db prefix on my prestashop test and I did not protect table name with `.

 

 

Best regards

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

Hi,

thanks for this great module!

 

How is it possible to put the video below the products images ???

 

prestashop 1.6.4.2 www.bigprintshop.fr

 

On my other shop in presta 1.4.8.3 with "matrice" template.

I have this error

 

Fatal error: Call to a member function assign() on a non-object in /home/www/modules/productvideos/productvideos.php on line 240

www.impression-rollup.fr

I am in smarty 2

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

On the continious increasing demand of prestashop users on forum. I have created productvideo module

 

This module Let's you add youtube presentation (or other link) for your products.

With this module you can add a videos embed code or link to your products,

it provide facility to add diffrent video for each product

the video will be displayed in the extra tab name product video on the product page (next to more info tab

).

Main usage is to add Youtube presentations for your products.

 

Please download attached zip file for complete module file

tested on prestashop 1.4+

 

could you please test it on prestashop v1.5.4.0 we upgraded and the videos are working fine but the module is now not functional to add more or modify existing ones. Thank you and keep up the great work.

Link to comment
Share on other sites

could you please test it on prestashop v1.5.4.0 we upgraded and the videos are working fine but the module is now not functional to add more or modify existing ones. Thank you and keep up the great work.

 

Hi, I have the same problem in prestashop v1.5.4.0

Thank you for your help!

 

Steve

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hi, I have a quick question about this module.

 

I think this is the perfect module that I have been looking for months!

 

Does it have maximum video it can embed on the video tab? Because I really need to embed A LOT of videos on some of my products.

 

Thank you in advance.

Link to comment
Share on other sites

could you please test it on prestashop v1.5.4.0 we upgraded and the videos are working fine but the module is now not functional to add more or modify existing ones. Thank you and keep up the great work.

 

Product Video Tab PrestaShop Module

 

I've seen several requests to the same effect. Our module has been thoroughly tested and is fully compatible with PS 1.5.4. See link above for more information.

 

Our module also allows you to add multiple videos per product.

 

Marty Shue

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 weeks later...
  • 4 weeks later...

I have added show info button in [your-theme]/product.tpl like this:

		<div id="short_description_block">
			{if $product->description_short}
				<div id="short_description_content" class="rte align_justify">{$product->description_short}</div>
			{/if}
			{if $product->description}
				<p class="buttons_bottom_block">
			<a href="javascript:{ldelim}{rdelim}" class="more_info_button">{l s='More details'}</a></br>
			
			<a href="javascript:{ldelim}{rdelim}" class="video_button">{l s='Watch product video'}</a>

			</p>
			{/if}

Is it possible to toggle this video button the same way as the video tab (hide it when no video is available)?

I've tried cloning the function for the video button in the "productvideos.php":

		function ShowVideoButton($params){
        global $smarty;
        $db = Db::getInstance();

        $id_product=Tools::getValue('id_product');
        $selectvideo="SELECT * FROM  `"._DB_PREFIX_."product_videos` where product_id='$id_product' limit 0,1";
        $resultvideo = Db::getInstance()->ExecuteS($selectvideo);

        $resultvideo= (count($resultvideo)>0 ? $resultvideo[0] : NULL );
		
		    if ($resultvideo == NULL){
            $smarty->assign('do_not_display_video_button', 'yes');
            return false;
        }
		
    }

and altering the "product.tpl" file in my theme with "{if !isset($do_not_display_video_button)}" and "{/if}" operators before and after the video button, but sadly no luck - while tab hides when video is not available, the button stays. Any one has ideas?

Edited by sting5 (see edit history)
Link to comment
Share on other sites

I did it! If anyone will try to toggle video button in product page accordingly to video module, there's no need to duplicate the function in productvideos.php like I did previously, simply add

 

"$smarty->assign('do_not_display_video_button', 'yes');"

 

in the existing function "hookProductTab" in the productvideos.php file, and add "{if !isset($do_not_display_video_button)}" and "{/if}" operators before and after the button code in product.tpl file, then everything works fine.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I think it's not possible to add more than 1 videos for each product. If pasted more than an iframe code for example:

<iframe src="http://www.youtube.com/embed/FIRSTVIDEO" width="320" height="240"></iframe>

<iframe src="http://www.youtube.com/embed/SECONDVIDEO" width="320" height="240"></iframe>

The second code <iframe> code part, just deleted. How to solve this problem ?

 

Anyway, thanks for great work :)

Link to comment
Share on other sites

  • 3 weeks later...

My webdev added this to our shop the other day, and it works well, thank you very much.

However I am experiencing a few problems.

PS 1.5.5 with multiple stores. All in all we have about 22 products that need/have a video. After adding the first 20 without a hitch, I'm now faced with the following.

When I now add a video to the corresponding product, the module adds a blank line after clicking 'Update the editor' and leaves the embedded code in place. I was able to delete these blank lines before, but I'm unable to do that now too.

Has anyone else experienced the same thing, and or have suggestions how to resolve this?

Link to comment
Share on other sites

  • 2 months later...

It is not working for me though on 1.5.6.1

 

Error message:

 

[PrestaShop] Fatal error in module Product:

Cannot redeclare class ProductCore

 

 

 

What do I do? :/

 

In productvideos.php:

replace:

include_once '../../classes/Product.php';

with:

$product = new Product();

Edited by Artx (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Hi, i want to add one video using this module on PS 1.5.6.1 and return this message "Forbidden, You don't have permission to access /admin0095/index.php on this server."

Anyone know what happens??

My onlineshop is www.movilexpress.eu

Thanks

 

Edit: solved, i see in this forum this permissions error and see that i can ask for this permissions to my hosting server's page, and they solved it fastly :)

Edited by JuanRamos (see edit history)
Link to comment
Share on other sites

  • 1 month later...

When i installed this module on my site then give me this error

 

Fatal error: Cannot redeclare class ProductCore in /opt/lampp/htdocs/prestashop_test/classes/Product.php on line 5498

 

How i can solve it ?

what prestashop version you use?

Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...

Hello

 

If all your looking at is to add a you tube video to short/long descriptions on the product page then see if this any use for you

 

http://screencast.com/t/bEKefBtYcT

 

Result

 

http://adultskunk.co.uk/en/evening-dresses/4-printed-dress.html?live_configurator_token=8f63a8939f73796696b9798dd0d21785&id_shop=1&id_employee=1&theme=&theme_font=

 

Paul

Link to comment
Share on other sites

  • 2 weeks later...

Hello

 

If all your looking at is to add a you tube video to short/long descriptions on the product page then see if this any use for you

 

http://screencast.com/t/bEKefBtYcT

 

Result

 

http://adultskunk.co.uk/en/evening-dresses/4-printed-dress.html?live_configurator_token=8f63a8939f73796696b9798dd0d21785&id_shop=1&id_employee=1&theme=&theme_font=

 

Paul

 

how if  I am add video from computer file ? please help, thank u

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Hello

 

If all your looking at is to add a you tube video to short/long descriptions on the product page then see if this any use for you

 

http://screencast.com/t/bEKefBtYcT

 

Result

 

http://adultskunk.co.uk/en/evening-dresses/4-printed-dress.html?live_configurator_token=8f63a8939f73796696b9798dd0d21785&id_shop=1&id_employee=1&theme=&theme_font=

 

Paul

 

Hi Paul,

 

How you added the video in PS 1.6? Installed you module see the beginning of this topic?

 

Thanks.

 

Jaroslav

Link to comment
Share on other sites

  • 3 months later...

Hi guys,

 

First of all, thanks for the amazing module! I've been looking for this for some while. It actually works like a charm on 1.6.14!

 

I have a question though. The video show directly at the product details and not in a separate tab. I'm not good in coding so my question is: what do I need to change to hide the video, until customers click on "Product video" to show the video in the separate tab?

 

(Here you can see what I mean: http://natuurlijkegezondheid.eu/hulpmiddelen/164-glucosemeter-gl44-4211125463151.html)

 

Thanks in advance for the help!

Link to comment
Share on other sites

  • 1 month later...

Hi guys,

 

First of all, thanks for the amazing module! I've been looking for this for some while. It actually works like a charm on 1.6.14!

 

I have a question though. The video show directly at the product details and not in a separate tab. I'm not good in coding so my question is: what do I need to change to hide the video, until customers click on "Product video" to show the video in the separate tab?

 

(Here you can see what I mean: http://natuurlijkegezondheid.eu/hulpmiddelen/164-glucosemeter-gl44-4211125463151.html)

 

Thanks in advance for the help!

 

I cannot see any videos added in the above product?

 

Cheers, K

Link to comment
Share on other sites

  • 4 months later...

Hello, I downloaded the file in the first post and installed the module.  I added a video in one of the products and in the product page I can see the video tab but not the video.  Also, in the module page when I enter the embed code I do not have a full text editor only a textarea.

 

It appears that the video tab is inside the comments ab so it cannot be displayed.

 

Is the file I downloaded the correct one for prestashop 1.6.1.1?

 

Here is a link to my shop http://byleo.bnc-webhosting.com/mods/2-bod-mecha.html

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...