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

Extra Fields??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-02-2004, 04:18 PM
 
spoonernyc spoonernyc is offline
 

Member
  
Join Date: Apr 2004
Posts: 18
 

Default Extra Fields??

What is the deal with Extra Fields?
The idea that I had when I initally heard of extra field was that you could use them to make extra fields that are not covered in the base line setup of xcart..

But how in the world do you use these things?

I made an extra field. Specs:

now what tag do I use to have that extra field show up in the product.tpl file?

{param00}
nope
{Spec:Extrafield}
nope

the manual brushes over this topic and only tells you how to add them the product entry page..

and if I get into the modules/ExtraFields/product.tpl it does not make any sense...

Also any html data I enter into an Extra Fields field is cleared upon submitting. How do I keep this from happening?

help!

thank you

jon spooner
Reply With Quote
  #2  
Old 05-02-2004, 04:43 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Use {$products[product].param00} in products.tpl

Just make sure it is within the {section} {/section} tags.
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #3  
Old 05-02-2004, 04:48 PM
 
spoonernyc spoonernyc is offline
 

Member
  
Join Date: Apr 2004
Posts: 18
 

Default

thank you Emerson!
a follow up question:

the section tags are for looping no?
So why would the

{$products[product].param00}

need to be in the midst of a loop?
I just want the data from param00 to be pulled when relating the the product ID. Shoudl I make a section loop with the product id as the cariable and only loop it one time?

anyone else have thoughts on the html clipping?

thanks again
Reply With Quote
  #4  
Old 05-02-2004, 04:54 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

That I don't know...

Looking into it tho
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #5  
Old 05-02-2004, 05:00 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Quote:
Originally Posted by spoonernyc
the section tags are for looping no?
So why would the

{$products[product].param00}

need to be in the midst of a loop?

The reason a section loop is required is $products is an array tha thas to be walk-throughed in order to return values.

{section name=product loop=$products}

means... loop over $products aray, with an index name of "product". Hence why {$products[product].param00} is used in a loop...

{$array[index].value}

__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #6  
Old 05-02-2004, 05:08 PM
 
spoonernyc spoonernyc is offline
 

Member
  
Join Date: Apr 2004
Posts: 18
 

Default

I have this code and it is not pulling out my data...

Code:
{section name=product loop=$products} {$products[product].param00} {/section}

so does $products contain all of the data related to a $productid held in an array?
Reply With Quote
  #7  
Old 05-02-2004, 05:17 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

which file exactly did you put that into?
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #8  
Old 05-02-2004, 06:02 PM
 
spoonernyc spoonernyc is offline
 

Member
  
Join Date: Apr 2004
Posts: 18
 

Default

it is in customer/main/product.tpl

here is the head of product.tpl up to the tag instance
Code:
{* $Id: product.tpl,v 1.78.2.4 2004/02/27 13:47:00 mclap Exp $ *} {include file="check_product_options_js.tpl"} {if $product.product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_product.tpl"} {else} {capture name=dialog} <table border=0 width=100% border=1> <form name=orderform method=post action="cart.php?mode=add" OnSubmit="javascript:if (!FormValidation()) return false"> <tr> <td valign=top align=left rowspan=2 width=100> {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url} {section name=product loop=$products} {$products[product].param00} {/section}</td> <td valign=top> {$product.descr}

an example page resides here:
http://www.sharpsusa.com/store/customer/product.php?productid=16133

if the code was working under the image would be a text entry (param00)

thanks for the help on this..
Reply With Quote
  #9  
Old 05-02-2004, 06:36 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

product.php won't have a $products array, since this variable/array doesn't exist, you'll need to copy some code from products.php into product.php and pass along the results to smarty.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #10  
Old 05-03-2004, 06:24 AM
 
spoonernyc spoonernyc is offline
 

Member
  
Join Date: Apr 2004
Posts: 18
 

Default


(in lieu of a totally lost emoticon)

I just don't get it.. I tried copying the $products array code from products.php and sticking it into product.php and then alerting smarty to its existence
$smarty->assign("products",$products);

but no luck

well since this is not really as easy as I thought I am just going to build HTML pages with add to cart links and just work on customizing the cart. Thanks for the help though, Emerson and BOOMER. I really appreciate it.

thanks again

Jon Spooner
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 02:15 AM.

   

 
X-Cart forums © 2001-2020