News:

Support the VirtueMart project and become a member

Main Menu

Custom fields rendering - updating

Started by Javix, July 09, 2012, 19:34:14 PM

Previous topic - Next topic

Javix

Hi,

I started using virtuemart with version 2.0.0. in January 2012. I set up the shop, did a lot of custom templating (using the views, as proposed), added many custom fields as needed by my customer....
And today I updated my virtuemart to the current version (2.0.8) and all of a sudden my custom fields don't work anymore.
After investing two hours reading and checking things, reviewing code, etc, I ended up comparing the two original /com_virtuemart/views/productdetails/tmpl/default.php template files and they look as they would belong to two different worlds, almost (kdiff3 shows everything in red).
Specifically, what affected the custom fields is that the older code:

foreach ($this->product->customfields as $customfield){


does not work anymore, I have to replace that with

foreach ($this->product->customfieldsSorted['normal'] as $customfield){


Isn't this change a little big for an apparently small version change? Actually I started with 2.0 thinking that my code would be longer lasting.
Am I wrong thinking this way?
Are those sort of changes expected with any minor update?
What I found most desperating was that this is not documented or at least I have been unable to find it within a reasonable time investition (2 hours).
It is not here
http://dev.virtuemart.net/projects/virtuemart/wiki/Product_custom_fields_without_stock_control
I found something related here (related, but not exact, nobody says "this does not work anymore" or "this class/property/method does not exist any longer"):
http://forum.virtuemart.net/index.php?topic=90833.msg330622;topicseen#msg330622
that is in page 12 of a very long thread.
Where is the appropriate place to look for changes? Do I have to read all these long threads before updating?
I read the changelog in the news but there was only a sentence about "refactoring custom fields".
Is there an api documentation where I can learn about the class changes?
About this particular change:
What different ways of sorting are there? Normal? are there others? Where can I read about these?

Is my custom template going to get obsolete with every update? I am talking about custom fields now, but I find many other big changes.

Thank you for your guidance.

Phil

I also am having problems with multiple custom fields and how to get them to template right.  With NO modifications, a custom field with two items loads like this :

The Custom Field Title is formatted center, and the option buttons are off the screen...    Any help?

[attachment cleanup by admin]