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

Category Price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-02-2009, 01:43 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Category Price

Ok, so I added a new field to categories called cat_price in phpMy admin.

This is basically a category price (all prods within a cate will have the same price).

I added this to category_modify.tpl to get the field to show in the admin.
Code:
<tr> <td height="10" class="FormButton" nowrap="nowrap">Category Price:</td> <td width="10" height="10">&nbsp;</td> <td height="10"> <input type="text" name="order_by" size="5" value="{if $category_error ne ""}{$smarty.post.cat_price}{elseif $mode ne "add"}{$current_category.cat_price}{/if}" /> </td> </tr>

But now Im not sure how to get the value to save in the DB.

I tried category_modify.php
Code:
# # Update general data of category # db_query("UPDATE $sql_tbl[categories] SET category='$category_name', description='$description', meta_title='$meta_title', meta_descr='$meta_descr', meta_keywords='$meta_keywords', avail='$avail', order_by='$order_by' , cat_price='$cat_price' WHERE categoryid='$cat'"); func_membership_update("category", $cat, $membershipids);

but the value is not saving. What am I doing wrong?
__________________
xcart 5.1.2
Reply With Quote
  #2  
Old 11-02-2009, 06:39 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Category Price

No. You need to add the new field to
#
# Update general data of category
#
$data = array(

same file. You also need to modify include/import_categories.php if you want to be able to import values for that field
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 11-02-2009, 08:44 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Category Price

no such line.

this is 4.1 if that makes a difference.

Ash
__________________
xcart 5.1.2
Reply With Quote
  #4  
Old 11-03-2009, 03:55 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Category Price

Yes it does make a difference. Sorry didn't get this from your original post. First you were making the change in the right place in the php file. But look at your tpl code - you have for the new price field "name=order_by" when you should have "name=cat_price" as you are reffering to that same name in the sql query. See if that helps
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 11-03-2009, 03:48 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Category Price

HAHA!! that was it.

thanks
__________________
xcart 5.1.2
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 11:20 AM.

   

 
X-Cart forums © 2001-2020