Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display HTML in Extra fields

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 10-15-2006, 11:54 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #12  
Old 10-15-2006, 12:22 PM
 
fogelka fogelka is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 83
 

Default 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.
__________________
xcart v4.0.18 [linux]

Loyalty Points, DSEFU, Easy Checkout, Featured Product Manager, Remember Me, Relevant Search, Vertical Flyouts, Multiple Category Templates. Loads of other tweaks and mods learned in forums.
Reply With Quote
  #13  
Old 01-03-2007, 05:47 AM
 
peter c peter c is offline
 

Advanced Member
  
Join Date: Dec 2006
Posts: 30
 

Default 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
__________________
X-Cart Version 4.1.5 | MySQL 4.1.21 | PHP 4.4.3 | Apache Apache/1.3.37 (Unix)
Reply With Quote
  #14  
Old 02-04-2007, 10:47 PM
 
phpmattk phpmattk is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 44
 

Default 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.
__________________
-matt
version 4.1.5
Reply With Quote
  #15  
Old 02-05-2007, 01:31 PM
 
phpmattk phpmattk is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 44
 

Default 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
__________________
-matt
version 4.1.5
Reply With Quote

The following user thanks phpmattk for this useful post:
jphillips (04-07-2010)
  #16  
Old 02-09-2007, 01:46 PM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Question Re: Display HTML in Extra fields

Is there anybody who wants to show what this does?
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #17  
Old 03-02-2007, 12:37 PM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default 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?
__________________
X-Cart version 4.0.19
Reply With Quote
  #18  
Old 04-04-2007, 04:03 AM
 
Plug Plug is offline
 

Member
  
Join Date: Oct 2006
Posts: 14
 

Default 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.
__________________
x-cart 4.0.19 Gold
www.the-plug.com
Reply With Quote
  #19  
Old 12-17-2007, 11:07 PM
  inboxnews's Avatar 
inboxnews inboxnews is offline
 

Senior Member
  
Join Date: Jul 2007
Posts: 121
 

Default 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.
__________________
XCART 4.1.8 [Linux]
Reply With Quote
  #20  
Old 12-19-2007, 08:51 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

Default Re: Display HTML in Extra fields

Does anyone know if this will work in version 4.1.9?

Thanks
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:25 PM.

   

 
X-Cart forums © 2001-2020