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)
-   -   Category Price (https://forum.x-cart.com/showthread.php?t=50483)

ARW VISIONS 11-02-2009 01:43 PM

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?

cflsystems 11-02-2009 06:39 PM

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

ARW VISIONS 11-02-2009 08:44 PM

Re: Category Price
 
no such line.

this is 4.1 if that makes a difference.

Ash

cflsystems 11-03-2009 03:55 AM

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

ARW VISIONS 11-03-2009 03:48 PM

Re: Category Price
 
HAHA!! that was it.

thanks :)


All times are GMT -8. The time now is 02:54 PM.

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