View Single Post
  #1  
Old 08-22-2008, 08:01 PM
 
rick2003 rick2003 is offline
 

Member
  
Join Date: Jan 2008
Posts: 20
 

Default simple solution to add youtube video

Hey, this is the simple mod, i have done to add youtube video.

going to the admin area, under products -> extra field

Add one field, name it "Video Link" service name Video_link, and the default value as "There is no video related to this product yet."

if you go the the product modify page in admin, in the last row you will find entry called Video link

under skin1/customer/main/ , creat a new *.tpl called video.tpl

add the code below:

Quote:
{* $Id: product_images.tpl,v 1.16.2.1 2006/05/18 08:02:40 max Exp $ *}
{capture name=dialog}
<center>
{section name=field loop=$extra_fields}
{if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value}
{$extra_fields[field].field_value}
{/if}
{/section}
</center>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_video content=$smarty.capture.dialog extra='width="100%"'}

And then go to skin1/main/product.tpl, After
Quote:
{include file="modules/Detailed_Product_Images/product_images.tpl" }
{/if}

add following code:

Quote:
{if $active_modules.Extra_Fields ne ""}
<p />
{include file="customer/main/video.tpl"}
{/if}

now the mode is complete, whenever you have upload video from youtube, copy the javascript code, and paste it into the video link field in the admin area under product modify.

at last, go into your database, change extra field from char to text.
See the result: www.lywoo.com

video at http://www.lywoo.com/product.php?productid=291&cat=40&page=2
__________________
Version 4.1.9
Highly Modified X-cart

www.lywoo.com
Reply With Quote