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)
-   -   Display HTML in Extra fields (https://forum.x-cart.com/showthread.php?t=21979)

balinor 10-15-2006 11:54 AM

Re: Display HTML in Extra fields
 
Well if you used that code it wouldn't work, the correct code would be:

<IMG src="{ImagesDir}/icon.gif">

but I don't think Smarty will work in that field. You may need to use skin1/images/icon.gif instead.

fogelka 10-15-2006 12:22 PM

Re: Display HTML in Extra fields
 
After trying what I thought was everything, it was with absolutely no expectation that I hit refresh after updating the code. It worked. Woo-hoo!

Thanks a lot, B.

peter c 01-03-2007 05:47 AM

Re: Display HTML in Extra fields
 
Grant

Not seeing anything in admin. here is code i have input:

Quote:

modifier.extrafield.php

<?php
if (!defined('XCART_START')) { header("Location: ../../../"); die("Access denied"); }

function smarty_modifier_extrafield($value, $mode) {
global $config, $sql_tbl;

$return = func_query_first_cell("SELECT value FROM ".$sql_tbl["extra_field_values"]." WHERE productid = $value AND fieldid= $mode");

if ($return)
return $return;
else
return "";
}

?>

Quote:

products.tpl

{$products[product].descr|truncate:300:"...":true}
{assign var="name" value=$products[product].productid|extrafield:5} {if $name ne ""}
name: {$name} {/if}

Quote:

products_t.tpl

{assign var="name" value=$products[product].productid|extrafield:5} {if $name ne ""}
name: {$name} {/if}

Quote:

product_modify.tpl

{if $extra_fields[field].field eq "name"}
<TEXTAREA name="efields[{$extra_fields[field].fieldid}]" rows="10" cols="45">{if $extra_fields[field].is_value eq 'Y'}{$extra_fields[field].field_value|escape: "html"}{else}{$extra_fields[field].value|escape:"html"}{/if}</TEXTAREA>
{else}
<INPUT type="text" name="efields[{$extra_fields[field].fieldid}]" size="24" value="{if $extra_fields[field].is_value eq 'Y'}{$extra_fields[field].field_value|escape: "html"}{else}{$extra_fields[field].value|escape:"html"}{/if}">
{/if}


Obviously coded wrong somewhere as it isn't showing frontend or adminend. but cannot see it. BTW name is the vaiable in extrafield and 5 is the number. Thanks

phpmattk 02-04-2007 10:47 PM

Re: Display HTML in Extra fields
 
Not Sure if this warrants its own thread or not. I had already made the input box into a text area for the extra_fields. However, it appears as if its defined as a varchar(255) in mysql, because its chopping of larger bits of text. Where can i change the datatype that is uses when creating the field in the database to tinytext or somthing a bit larger than 255. Or is it somthing else truncating my strings.

phpmattk 02-05-2007 01:31 PM

Re: Display HTML in Extra fields
 
As of v 4.1.5 the field you want (to increase the extra field capacity) is in the 'xcart_extra_field_values' table and you'll want to change the 'value' fields datatype to text, blob, etc

Warwick 02-09-2007 01:46 PM

Re: Display HTML in Extra fields
 
Is there anybody who wants to show what this does?

alru111 03-02-2007 12:37 PM

Re: Display HTML in Extra fields
 
if I put a form into the extra filed, will I be able to pass the vars to the cart?

Plug 04-04-2007 04:03 AM

Re: Display HTML in Extra fields
 
Does anyone know if there is a way to make this work on product.tpl. The reason is that although the extra fields sre already shown it would allow me to locate the html field in a different location to the others.

inboxnews 12-17-2007 11:07 PM

Re: Display HTML in Extra fields
 
Quote:

Originally Posted by Plug
Does anyone know if there is a way to make this work on product.tpl. The reason is that although the extra fields sre already shown it would allow me to locate the html field in a different location to the others.


Ditto.

photo 12-19-2007 08:51 AM

Re: Display HTML in Extra fields
 
Does anyone know if this will work in version 4.1.9?

Thanks


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

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