X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   simple solution to add youtube video (https://forum.x-cart.com/showthread.php?t=41930)

rick2003 08-22-2008 08:01 PM

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

WhiteDoveGifts 08-23-2008 12:09 AM

Re: simple solution to add youtube video
 
Nice mod! Kudos for you

giftsngadgets 03-04-2009 04:19 PM

Re: simple solution to add youtube video
 
Hello
When I add {if $active_modules.Extra_Fields ne ""}
<p />
{include file="customer/main/video.tpl"}
{/if}
to product.tpl
and click 'save'
I get
'File Operation is Failed' message

balinor 03-04-2009 04:19 PM

Re: simple solution to add youtube video
 
Really need to know what version you are using to be able to help you - please update your signature with that info. Thank you!

Lanni 05-06-2009 07:20 AM

Re: simple solution to add youtube video
 
[
at last, go into your database, change extra field from char to text.



sorry how do you change this in C.panel, i have done everything else fine but I dont know my way around php admin very well...great site by the way!


All times are GMT -8. The time now is 01:27 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.