X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Calling an Extra Field (https://forum.x-cart.com/showthread.php?t=28158)

MCM 01-18-2007 09:42 PM

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

balinor 01-19-2007 02:58 AM

Re: Calling an Extra Field
 
Depends on what template you want to call it in. Where do you want it to display?

PhilJ 01-19-2007 06:14 AM

Re: Calling an Extra Field
 
http://forum.x-cart.com/showthread.php?t=26844

MCM 01-19-2007 07:38 AM

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

PhilJ 01-19-2007 09:23 AM

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

MCM 01-20-2007 04:31 PM

Re: Calling an Extra Field
 
Brilliant! Thanks, Phil!


All times are GMT -8. The time now is 10:31 AM.

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