News:

Support the VirtueMart project and become a member

Main Menu

Editing customfields directly to the database does not work

Started by mmx, November 20, 2013, 20:57:51 PM

Previous topic - Next topic

mmx

Hello! I hope this is the correct section to post the problem I am facing..

First I would like to tell you what I do and why..

My uncle has an e-shop with clothing..

Usually he receives from his supplier, a csv file which contains all the data about the products my uncle needs to add to his eshop.

Because of the huge number of the products, I created a python script which reads the csv file and inserts the products' data directly to the database..


Though I managed to find some logical conditions on how to categorize the products etc, I could not find any logic on how to add the sizes for each product correctly..


The only solution I found was to create a new custom-fields category and add there all the possible sizes that exist on the eshop.

In order to do this I tweaked the virtuemart_customs table and changed the length of the database field "custom_value" from 255 to 2000 in order to fit everything..

The problem is that even if the sizes (L, XL, XXL) are set for each product, are not shown on the eshop..


I was thinking that maybe the problem is that the length of the field is hard-coded in the php code of virtuemart and when it tries to retrieve the sizes from the table reads only the first 255 cahracters.. so any size after that is ignored..


I hope my poor English gave you to understand what problem I am facing..

Any suggestions how to work around it would be highly appreciated!


Thanks!

dontflinch

you cannot change to char(>255) it must be varchar if over 255.  I made mine varchar(2048) and it worked for me.  I think varchar would be better field for this in future, 255 is too short imo too.

dontflinch

I may have misunderstood your problem.

here is a tutorial on how to add custom fields:
http://blog.sysgenmedia.com/2013/03/how-to-set-up-custom-attribute-drop-down-fields-in-virtuemart-2-x/

be sure and follow the complete instructions on adding to product including "**HERE IS WHERE IT GETS CONFUSING**".