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

Calling an Extra Field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-18-2007, 09:42 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default Calling an Extra Field

Hi,

I'd like to have a simple yes/no extra field for a logic statement. In a template, how do I call this extra field? I've tried $products[product].Reduced but it didn't work. Is there a way to call the extra field (called reduced) or do I have to add a field to my database? If the latter, is there a tutorial available to show me how to add to the database, and then call the variable properly?

Thanks,

Jeremy
__________________
Version 4.0.17/4.0.18
Reply With Quote
  #2  
Old 01-19-2007, 02:58 AM
 
balinor balinor is offline
 

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

Default Re: Calling an Extra Field

Depends on what template you want to call it in. Where do you want it to display?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-19-2007, 06:14 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Calling an Extra Field

http://forum.x-cart.com/showthread.php?t=26844
__________________
xcartmods.co.uk
Reply With Quote
  #4  
Old 01-19-2007, 07:38 AM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default Re: Calling an Extra Field

Phil,

I tried that, but I couldn't find $query_data = array( ... ); in include/Product_Modify.php, so I didn't know how to continue. I want to call it in the customer/main/products.tpl and just use a logic statement to dictate what should be displayed given the assigned value for each item.

Jeremy
__________________
Version 4.0.17/4.0.18
Reply With Quote
  #5  
Old 01-19-2007, 09:23 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Calling an Extra Field

That's because you are using v4.0.x, that code is meant for v4.1.x

In /include/product_modify.php look for this instead...

Code:
# # Update product data # db_query("UPDATE $sql_tbl[products] SET product='$product', descr='$descr', fulldescr='$fulldescr', avail='$avail', list_price='$list_price', weight='$weight', productcode='$productcode', forsale='$forsale', distribution='$distribution', free_shipping='$free_shipping', shipping_freight='$shipping_freight', discount_avail='$discount_avail', min_amount='$min_amount', return_time = '$return_time', low_avail_limit='$low_avail_limit', free_tax='$free_tax' WHERE productid='$productid'");

Add the new fields like this...

Code:
newfield='$newfield',

HTH
__________________
xcartmods.co.uk
Reply With Quote
  #6  
Old 01-20-2007, 04:31 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default Re: Calling an Extra Field

Brilliant! Thanks, Phil!
__________________
Version 4.0.17/4.0.18
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:05 PM.

   

 
X-Cart forums © 2001-2020