Forums / Basic Configuration / Flash Video on Products page

Flash Video on Products page

Locked

Views: 11,647

Results 1 to 20 of 28
This thread is locked. New replies are disabled.
29 Mar 2008, 6:33 AM
#1
lqmatrix avatar

lqmatrix

New Zenner

Join Date:
Mar 2008
Posts:
7
Plugin Contributions:
0

Flash Video on Products page

Hey I am having trouble figuring out how to add a different video on each product page. I was successful in embedding one into the home page but don't know enough php to go any further. Any ideas? Any help would be greatly appreciated.

29 Mar 2008, 6:56 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Flash Video on Products page

Using flash is mostly html and js so if you have onew on you home page you have the js thing squared.

Just include the image code in the product description area where you want it - before the text - middle of the text or after

Zen-Venom Get Bitten

29 Mar 2008, 4:32 PM
#3
lqmatrix avatar

lqmatrix

New Zenner

Join Date:
Mar 2008
Posts:
7
Plugin Contributions:
0

Re: Flash Video on Products page

Ight so I figured it out, basically what I did was insert my flash code into the tpl_product_info_display.php page and then concatenated the product id onto the end of the swf file. This enables you to have a unique video playing based on each product id. So my code looked like this:

<object type="application/x-shockwave-flash" data="includes/languages/english/ss/video<?php echo $products_id_current; ?>.swf" width="368px" height="280px"> <param name="movie" value="includes/languages/english/ss/video**<?php echo $products_id_current; ?>**.swf" /> <param name="quality" value="high"><param name="BGCOLOR" value="#000000"> <param name="menu" value="false"> </object>
29 Mar 2008, 6:13 PM
#4
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Flash Video on Products page

Thanks for sharing.. so the videos are stored in

includes/languages/english/ss/video
and swf files are named according to each product number?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

29 Mar 2008, 7:01 PM
#5
lqmatrix avatar

lqmatrix

New Zenner

Join Date:
Mar 2008
Posts:
7
Plugin Contributions:
0

Re: Flash Video on Products page

Yup! Then whenever a new video is needed, it just needs to have the product id at the end.

29 Mar 2008, 7:02 PM
#6
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Flash Video on Products page

Very clever snippit of code there...will give it a try,
thanks for confirming my assumption re swf code.
:clap:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

7 Jul 2008, 8:45 PM
#7
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

lqmatrix:

Ight so I figured it out, basically what I did was insert my flash code into the tpl_product_info_display.php page and then concatenated the product id onto the end of the swf file. This enables you to have a unique video playing based on each product id. So my code looked like this:

<object type="application/x-shockwave-flash" data="includes/languages/english/ss/video<?php echo $products_id_current; ?>.swf" width="368px" height="280px"> <param name="movie" value="includes/languages/english/ss/video**<?php echo $products_id_current; ?>**.swf" /> <param name="quality" value="high"><param name="BGCOLOR" value="#000000"> <param name="menu" value="false"> </object>

Can someone help me out here? I am new at php coding in zen cart-
Where does the product id actually go?

And does the .swf file name need to be the id number to match, ex.) id33.swf
I am assuming the flash file name would go before the .swf-

I have tried adding the name of my flash file before the .swf in both places and only get a black box where the flash file should be showing. I have added the ss/video folders, and my flash file is located under the video folder.

Any help would be greatly appreciated! Thanks to all in advance!! :smile:
Miranda

7 Jul 2008, 10:02 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Flash Video on Products page

Mir13,

Are you placing this code in a copy of your tpl_product_info_display.php file?

The code allows for a dynamic pointing and your swf's are stored in
includes/languages/english/ss/video folder that you create

Your swf's are named with the product ID

lqmatrix:

Then whenever a new video is needed, it just needs to have the product id at the end
Maybe OP will post a bit more detail

Zen-Venom Get Bitten

7 Jul 2008, 10:11 PM
#9
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

Thanks for the quick reply!

No, I am placing the code in the actual tpl_product_info_display.php file under template_default-

So if my product id was 33, this section of code needs to look like:

<param name="movie" value="includes/languages/english/ss/video<?php echo $products_id_current; ?>33.swf" />

:frusty:
The whole php echo part is confusing to me-
Does that part of the code need to be edited to match the file name or is that just code pulling the product by it's id?

Thank you!!!!

7 Jul 2008, 10:43 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Flash Video on Products page

No, I am placing the code in the actual tpl_product_info_display.php file under template_default-
You should NEVER edit the core files
https://www.zen-cart.com/tutorials/index.php?article=36
https://www.zen-cart.com/tutorials/index.php?article=232
https://www.zen-cart.com/tutorials/index.php?article=142
Does that part of the code need to be edited to match the file name or is that just code pulling the product by it's id?
No, it should be as posted to keep it dynamic for other products

<param name="movie" value="includes/languages/english/ss/video<?php echo $products_id_current; ?>.swf" />

And follow the suggested location for the swf files

Zen-Venom Get Bitten

7 Jul 2008, 11:27 PM
#11
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

Thanks,
well I have created a CUSTOM folder and copied the template folders and the tpl_product_info_display.php file and added the code to that file.
But, nothing happens, my change is not reflected in the browser-

Still, even editing the original file, i have nothing but a black square, which makes me think somehting is not linked correctly, file name wise with the flash file-

I really need some clarification on how the flash file needs to be named-
if my product is 33, then the flash file located under ss/video should be 33.swf- is that correct?
Then in the line of code added to the tpl file, no changes need to be made- is that correct? I do not understand how it would know to pull the 33.swf file-

Please help, anyone- Thank you!!:no:

7 Jul 2008, 11:41 PM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Flash Video on Products page

Mir13,

The naming convention is what I hoped another, maybe the OP, would poste back on and they still may.

But you can try

??.swf33
??.swf_33

or

??33.swf
??_33.swf

due to what was posted about adding it to the end

Zen-Venom Get Bitten

7 Jul 2008, 11:58 PM
#13
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Flash Video on Products page

Mir13:

Thanks,
well I have created a CUSTOM folder and copied the template folders and the tpl_product_info_display.php file and added the code to that file.
But, nothing happens, my change is not reflected in the browser-

if my product is 33, then the flash file located under ss/video should be 33.swf - is that correct?
Then in the line of code added to the tpl file, no changes need to be made - is that correct?

Your logic looks good and I wonder if there is a path problem?

What I would do is create your CUSTOM dir. here:

<object type="application/x-shockwave-flash" data="includes/languages/english/**CUSTOM**/ss/video<?php echo $products_id_current; ?>.swf" width="368px" height="280px"> <param name="movie" value="includes/languages/english/**CUSTOM**/ss/video<?php echo $products_id_current; ?>.swf" /> <param name="quality" value="high"><param name="BGCOLOR" value="#000000"> <param name="menu" value="false"> </object>

But first, load the file in your Browser to verify path is correct.

Using your example:
http:/yoursite.com/includes/languages/english/CUSTOM/ss/video/33.swf

The above presumes everything else related to using the Overrides is setup correctly. :smile:

The learning is in the doing.

Potent Products

8 Jul 2008, 12:00 AM
#14
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

I'm sorry, still don't understand-
Are you saying to add this to the code?

<param name="movie" value="includes/languages/english/ss/video<?php echo $products_id_current; ?>.swf_33" /> Or do I need to name the flash file like that. It seems any way I try, I still have a huge black box.

:wacko:Thanks!

8 Jul 2008, 12:02 AM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Flash Video on Products page

Leave the code as posted.....

Try naming the swf file in the several variations suggested

Zen-Venom Get Bitten

8 Jul 2008, 2:19 AM
#16
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Flash Video on Products page

Mir13:

So if my product id was 33, this section of code needs to look like:

<param name="movie" value="includes/languages/english/ss/video<?php echo $products_id_current; ?>33.swf" />

Leave off the '33'

<param name="movie" value="includes/languages/english/ss/video<?php echo $products_id_current; ?>.swf" />
```There some different ways you can do this, so need to think how and what your sending out is used.  
1 Do you mind if the movie is downloaded?
2 Are your visitors using IE7? 
3 Are the movies in auto play... start soon as loaded or have a play button?  
4 Are you converting movies to flash?

SwfObject I think is easier to use with flash files and php together.  If you plan on using the old param/object tags, be sure to use both.

Dave
Always forward thinking... Lost my mind!

8 Jul 2008, 4:16 PM
#17
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

Thank you all for replying to me!
I really, really, really appreciated it!

I have tested the swf files, by previewing them in IE7, they do work. I even have a flash file working on the home page-

I just don't understand what the problem is-
I have created the CUSTOM folder, even tried it in both places mentioned above-
Still only a big black box?

Is there a step somewhere left out that I have not done to make this work?
The code is in the tpl_product_info_display.php file-
The flash videos are stored under ss/video and named as the product id-
The do work when previewed.
I am using zencart version 1.3.8a with
Database Patch Level: 1.3.8

I know this is something really simple and it is driving me crazy!

Has anyone else really made this work?
Was anything else modified to make it work?

Please keep posting, I know it can work- you can make anything work as long as it has been coded correctly, right?

Thank you all!!!
:cry:

8 Jul 2008, 9:36 PM
#18
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Flash Video on Products page

Mir13:

Thank you all for replying to me!
I really, really, really appreciated it!

I have tested the swf files, by previewing them in IE7, they do work. I even have a flash file working on the home page-

I just don't understand what the problem is-
I have created the CUSTOM folder, even tried it in both places mentioned above-
Still only a big black box?

Is there a step somewhere left out that I have not done to make this work?
The code is in the tpl_product_info_display.php file-
The flash videos are stored under ss/video and named as the product id-
The do work when previewed.
I am using zencart version 1.3.8a with
Database Patch Level: 1.3.8

I know this is something really simple and it is driving me crazy!

Has anyone else really made this work?
Was anything else modified to make it work?

Please keep posting, I know it can work- you can make anything work as long as it has been coded correctly, right?

Thank you all!!!
:cry:
Problem sorted via PM's i.e.
Videos/swf files in incorrect folder..should be
includes/languages/english/ss/video
Template tpl_product_info_display.php is in incorrect folder
should be /includes/templates/classic/templates
because site currently using classic template
:smile:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

9 Jul 2008, 12:14 AM
#19
mir13 avatar

mir13

New Zenner

Join Date:
May 2008
Posts:
27
Plugin Contributions:
0

Re: Flash Video on Products page

Thank you all so much!
Yes, my files are not in the correct folders, which I will fix. I just wanted to see the video work either way- regardless of what folder was being accessed. It was driving me crazy!

But, I also figured out by looking at the page source code that I forgot to add a / after the video folder in the coding... ss/video/33.swf
It was looking for ss/video33.swf- once I changed it, the video worked.

Now all I need to know, and I'm sure someone out there knows or may be able to figure it out- I have a category that I do not want a flash file to play in-
but with this code being used, it is searching for a flash file with every product.
Is there a way to make an exception in the code?

Any help will be greatly appreciated!!!
Thank you all again!

:D
I love zen cart! AND all the zen cart gurus-

9 Jul 2008, 1:43 AM
#20
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Flash Video on Products page

Mir13:

Now all I need to know, and I'm sure someone out there knows or may be able to figure it out- I have a category that I do not want a flash file to play in-
but with this code being used, it is searching for a flash file with every product.
Is there a way to make an exception in the code?

You can get into some heavy coding to make something work. Creating a loader movie that would load anything you want. Best to keep it simple, turn your image into a flash file, then it wouldn't mater. One frame, one image shouldn't make the file size much bigger then a jpeg.

Dave
Always forward thinking... Lost my mind!