View Single Post
  #1  
Old 06-11-2004, 09:56 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default Adding field to product table and updating from admin

** SOLUTION is 6 posts or so below **

I'm trying to add a checkbox field to my products table and update it through the product modify in the backend.

I keep getting errors. So frustrated.

I'm trying to add a field called discontinued that would be a yes/no checkbox.

The problem is either in the product_modify.tpl or in the include/product_modify.php files. I could have swore that there is a post here that covers this but after searching for 2 hours, I give up.

HELP ME PLEASE.

here is where I added to my product_modify.php

Code:
# # Update product data # db_query("update $sql_tbl[products] set product='$product', categoryid='$categoryid', categoryid1='$categoryid1', categoryid2='$categoryid2', categoryid3='$categoryid3', brand='$brand', model='$model', 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', param00='$param00', param01='$param01', param02='$param02', param03='$param03', param04='$param04', param05='$param05', param06='$param06', param07='$param07', param08='$param08', param09='$param09', low_avail_limit='$low_avail_limit', free_tax' $apply_canadian_taxes where productid='$productid' discontinued='$discontinued'");

and here is my .tpl

Code:
<TD class=ProductDetails height="11">{$lng.lbl_apply_global_discounts}</TD> <TD class=ProductDetails height="11"> <INPUT type=checkbox name=discount_avail value="Y" {if $product.discontinued ne ""}checked{elseif $product.discount_avail eq "Y"}checked{/if}> </TD> </TR> <TR> <TD class=ProductDetails height="11">{$lng.lbl_discontinued}</TD> <TD class=ProductDetails height="11"> <INPUT type=checkbox name=discontinued value="Y" {if $product.productid eq ""}checked{elseif $product.discontinued eq "Y"}checked{/if}> </TD> </TR>
Reply With Quote