News:

Looking for documentation? Take a look on our wiki

Main Menu

Short text custom field

Started by tunyafix, January 16, 2012, 15:20:55 PM

Previous topic - Next topic

tunyafix

Hi i want to know how to configure a text area in custom fields. In Virtuemart 1.1.X there are "Text" and "Short text" but in VM 2.0 there aren't

Thanx!!

tunyafix

Hi in administrator/components/com_virtuemart/models/customfields.php in function getField_types() there is:
return array( 'S' =>'COM_VIRTUEMART_CUSTOM_STRING',
         'I'=>'COM_VIRTUEMART_CUSTOM_INT',
         'P'=>'COM_VIRTUEMART_CUSTOM_PARENT',
         'B'=>'COM_VIRTUEMART_CUSTOM_BOOL',
         'D'=>'COM_VIRTUEMART_DATE',
         'T'=>'COM_VIRTUEMART_TIME',
         'M'=>'COM_VIRTUEMART_IMAGE',
         'V'=>'COM_VIRTUEMART_CUSTOM_CART_VARIANT',
         'E'=>'COM_VIRTUEMART_CUSTOM_EXTENSION'
         );

There aren't anything about textarea. The basic problem is in table to save relation between product and custom parameter:
#__virtuemart_product_customfields

custom_value   char(255)   

Because is a char of 255 you can store a textarea (at least complete)

I suggest to add other field, or use the custom_param (but it is to store plugin parameters....)

Any suggestion?, I'm thinking to create other table to store data text (I will store first 255 chars in #__virtuemart_product_customfields.custom_value and the complete text value in the new table). What do you think about it?

Thanks!
Antoni


tunyafix

I added some changes to do this

I created a new table to store the textare value, in the custom field only stores the firts 255 chars. You can enable to search only in first 255

I attached diff patch

Cheers

[attachment cleanup by admin]

nikonrules

Hi,

Thanks for the post on the change for the textinput to textarea. Could you explain to me how to apply this diff patch to make the change? I have downloaded your diff file but dont know how to implement / apply the patch.

Your assistance will be appreciated.

Regards

Jonathan