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

Adding custom fields of type text

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-24-2014, 04:12 AM
  johngwms's Avatar 
johngwms johngwms is offline
 

Senior Member
  
Join Date: Mar 2013
Location: North Wales
Posts: 191
 

Default Adding custom fields of type text

I need the ability to create additional custom fields which can be edited (as per the detailed description) with the WYSIWYG editor.

Which table should I add the additional fields to? Bear in mind that they need to be of type TEXT so cannot be added directly by X-Cart in the extra fields table. I thought of adding them to the same table holding the detailed description field?

Presumably I should be able to use similar Smarty code that handles the Product detailed description field?
__________________
John Legg
www.TheDebugStore.com

5.4.1.18 Business, Crisp White Skin Template
Backorder-Preorder Module
X-Cart to Zoho Creator (in progress)
Zoho Creator <-> Zoho Inventory for order processing
NGINX hosted - XC virtual server
Reply With Quote
  #2  
Old 01-24-2014, 08:32 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Adding custom fields of type text

I've done this in the past - You'll first need to create the custom fields within the xcart_products table.

Then some code edits are required within certain .php & .tpl files.

Have a look at this youtube video, it should point you in the right direction - http://www.youtube.com/watch?v=-7ESOW0pKU4
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #3  
Old 01-24-2014, 09:01 AM
  johngwms's Avatar 
johngwms johngwms is offline
 

Senior Member
  
Join Date: Mar 2013
Location: North Wales
Posts: 191
 

Default Re: Adding custom fields of type text

Thanks

I had a feeling that the fields needed to be added to the table xcart_products_lng_en. This table contains the descr and fulldescr fields of type text and it would allow me then to modify the fields for language variants in the future.

The table xcart_products table in its default state does not seem to contain any text fields, just varchar(255) fields. I am sure there is a goods reason for this?

I was thinking that if I placed the fields in the xcart_products_lng_en table, I would be able to use similar php code and tpl smarty code as the description fields to process the new fields.

Maybe I am worrying too much.
__________________
John Legg
www.TheDebugStore.com

5.4.1.18 Business, Crisp White Skin Template
Backorder-Preorder Module
X-Cart to Zoho Creator (in progress)
Zoho Creator <-> Zoho Inventory for order processing
NGINX hosted - XC virtual server
Reply With Quote
  #4  
Old 01-24-2014, 09:19 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Adding custom fields of type text

I guess xcart_products_lng_en is the logical place to create the fields if you are creating an multilingual site.
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:16 PM.

   

 
X-Cart forums © 2001-2020