| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Adding new fields to category pages | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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?
__________________
X-Cart PRO 4.4 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() You can email me, I can help you. Email in signature
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
![]() Can you share how you achieved this? Thanks
__________________
Darren X-Cart Gold 4.3.1 |
|||||||
#4
|
|||||||
|
|||||||
![]() would you pls share your method here?
__________________
x-cart gold 4.7.12 http://www.prescriptionglasses123.com/ http://www.glassespeople.com http://www.loupesusa.com http://www.eyeglassesclub.com |
|||||||
#5
|
|||||||||
|
|||||||||
![]() 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)
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||
|
|||||||
![]() Quote:
details, and sample code, pls!
__________________
x-cart gold 4.7.12 http://www.prescriptionglasses123.com/ http://www.glassespeople.com http://www.loupesusa.com http://www.eyeglassesclub.com |
|||||||
#7
|
|||||||
|
|||||||
![]() 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:
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:
5. Place the Smarty tag to call the new data anywhere in a category page, using the following code: HTML Code:
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',
__________________
Darren X-Cart Gold 4.3.1 |
|||||||
|
#8
|
|||||||
|
|||||||
![]() Quote:
i do not understand this, i have tried this, did not find any difference.
__________________
X-Cart Version: 4.7.12 GOLD www.cheapglasses123.com prescription glasses online at discounted prices. prescriptionglassesusa.com www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|