![]() |
Adding new fields to category pages
I'm looking to add some additional fields to category pages. I'm wondering if anyone has experience with this and would be willing to do some consulting or offer some assistance?
|
Re: Adding new fields to category pages
You can email me, I can help you. Email in signature
|
Re: Adding new fields to category pages
Can you share how you achieved this? Thanks
|
Re: Adding new fields to category pages
would you pls share your method here?
|
Re: Adding new fields to category pages
You have to add the field(s) to categories table, modify the admin template to show the new field(s), modify the php script to read/write in the database for the new field(s)
|
Re: Adding new fields to category pages
Quote:
details, and sample code, pls! |
Re: Adding new fields to category pages
Quote:
Good news, I figured out how to do this myself, here is my method: Version: X-Cart Gold 4.4.3 Steps for adding a new column to X-Cart category data MySQL: 1. To create a new column in the `xcart_categories`, enter the following line into the SQL query box: Code:
ALTER TABLE `xcart_categories` ADD `new_column` TEXT NOT NULL; PHP: 2. Add the new column to the "// Prepare an array for further processing" array in \admin\category_modify.php using the following example: PHP Code:
3. Create a new array for the new column in the $import_specification['CATEGORIES'] array in \include\import_categories.php using the following example: PHP Code:
If you need to set a default value, use the following example: PHP Code:
If you need to set a type, use the following example: PHP Code:
Smarty: 4. In the {$SkinDir}\main\product_details.tpl file add a new row for the new column so it is editable in the Admin area, for example: HTML Code:
<tr> 5. Place the Smarty tag to call the new data anywhere in a category page, using the following code: HTML Code:
{$current_category.new_column} NOTE: You may need to force a cache regeneration if you get an X-Cart SQL error (code 79). It will say there is a mis-match between sent data and database table structure, however this is usually a cache issue. Visit yoursite.com/cleanup.php and/or use "Force Cache Regeneration" in the Maintenance section of the admin area. This usually fixes the error. If not, double check your database structure. NOTE: If the field you are creating will contain HTML tags, you need to include this new column into a "trusted post variables" array. You do this in \admin\category_modify.php Inside: $trusted_post_variables = array(' Include: 'new_column', |
Re: Adding new fields to category pages
Quote:
i do not understand this, i have tried this, did not find any difference. |
All times are GMT -8. The time now is 09:33 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.