I am really pulling my hair out on this one. I am on the 1.3.8a of Zen Cart. I would like to add a preview video to product descriptions. I would liek to use the JW Player to do this.
According to their website the code I need to add is as follows:
<script type='text/javascript' src='swfobject.js'></script>
<div id='mediaspace'>This text will be replaced</div> <script type='text/javascript'>var so = new SWFObject('player.swf','mpl','470','260','9');so.addParam('allowfullscreen','tru e');so.addParam('allowscriptaccess','always');so.addParam('wmode','opaque');so.a ddVariable('file',' http://mywebsite/myvideo.flv');so.addVariable('image','http://mywebsite/mypic.jpg');so.addVariable('frontcolor','ffffff');so.addVariable('lightcolor','c c9900');so.addVariable('skin','http://www.longtailvideo.com/jw/upload/overlay.swf');so.addVariable('controlbar','over');so.write('mediaspace');</script>
If I add this to the product description via Zencart's built in HTML editor, it works. But the next time I go to the product page in the admin the code no longer appears! Its like Zen cart is erasing it everytime you open the Product Editor in the Admin console.
2nd problem: I don't want to hardcode the filename into the code, I want to add a variable. How can I do this? I tried:
<script type='text/javascript' src='swfobject.js'></script> <div id='mediaspace'>This text will be replaced</div> <script type='text/javascript'>var so = new SWFObject('player.swf','mpl','470','260','9');so.addParam('allowfullscreen','tru e');so.addParam('allowscriptaccess','always');so.addParam('wmode','opaque');so.a ddVariable('file',' http://mywebsite/<?php echo$ products_id_current; ?>.flv');so.addVariable('image','http://mywebsite/<?php echo$ products_id_current; ?>.jpg');so.addVariable('frontcolor','ffffff');so.addVariable('lightcolor','cc99 00');so.addVariable('skin','http://www.longtailvideo.com/jw/upload/overlay.swf');so.addVariable('controlbar','over');so.write('mediaspace');</script>
This doesn't work. I don't think I can use PHP in the Zen Cart Product HTML editor. What are my options???



