VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: gba on December 15, 2014, 15:15:19 PM

Title: [solved] Custom fields do not display in cart
Post by: gba on December 15, 2014, 15:15:19 PM
Hello all!

I just updated VM2.9.8 to VM3.0.2.
Now on clicking 'Add to cart' the values of the custom fields I created before are not stored in the cart anymore.
Does anyone have any idea, why?

I am very grateful for any useful hint, as this crashes all my work I had made with VM2.9.8.
Thank you very much in advance!

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: Milbo on December 18, 2014, 09:46:35 AM
This is indeed strange. Which customfields are affected?
Title: Re: Custom fields do not display in cart
Post by: balai on December 18, 2014, 11:02:57 AM
Check if your custom fields as enabled as "Cart Input" and "Cart Attribute" in the custom field's pages
Title: Re: Custom fields do not display in cart
Post by: gba on December 18, 2014, 16:15:32 PM
Hello!

Thank you very much for your replies.
The custom field IS enabled as "Cart Input" and "Cart Attribute" in the custom field's backend.

To my shame I have to admit something:
I mistakenly placed the custom fields generation out of the add to cart form in the category view template ...   :-[

After correction now, if I add a product to the cart, neither the cart nor the product page loads anymore, until I remove the custom field from the product in backend.
I really have no idea, why...

I attach the custom field files, I created.
To me everything seems all right with the source code...

Still happy about any hint!  :'(

Kind regards,
Gerald

[attachment cleanup by admin]
Title: Re: Custom fields do not display in cart
Post by: AH on December 18, 2014, 16:41:04 PM
reload the base frontend views and remove your overrides

Then start again!
Title: Re: Custom fields do not display in cart
Post by: gba on December 18, 2014, 16:43:26 PM
Hi!

Thank you for your very quick response!
??? What do you mean? (this is my first time creating custom fields...)

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: Milbo on December 18, 2014, 20:42:34 PM
You dont need to work with overrides. If you set a customfield to "is_cart_attribute" you will see it in your cart. Same for userfields, you can set them available in cart and then you have there new fields without overrides.
Title: Re: Custom fields do not display in cart
Post by: gba on December 18, 2014, 21:42:20 PM
Hi!

Thank you for your explanation.
What do I have to remove from which file then?

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: Milbo on December 18, 2014, 21:59:20 PM
http://docs.virtuemart.net/tutorials/templating-layouts.html
Title: Re: Custom fields do not display in cart
Post by: gba on December 19, 2014, 07:24:14 AM
Hello!

Thanks for the link to the documentation.
Actually - if I'm right, I DO need the default template file:
Depending on whether in the product backend the custom field is filled in or not, the field shall be displayed differently.

I am wondering, why adding a product having my custom field to the cart crashes the cart...

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: gba on December 22, 2014, 12:30:12 PM
Hello again!

Maybe there is some misunderstanding:
I am not overriding the default.php in the template folder - I am just using default.php for displaying the value of the custom field.
Could anyone, please, have a look at my custom field plugin?
Maybe I made something wrong in the plugin code...?

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: gba on December 22, 2014, 13:45:17 PM
Hi all!

I just noticed, that the same problem appears with the custom field plugin 'Custom Text Input':
If a custom field is added to a product, and the product is added to the cart, neither the product page nor the cart load anymore - no matter if the field is left empty or filled in.

Anyone any idea?
Maybe someone is already working on that issue?

Kind regards,
Gerald
Title: Re: Custom fields do not display in cart
Post by: gba on February 02, 2015, 13:26:48 PM
Hi all!

There was no templating problem with my custom fields, as already mentioned.
It seems to be connected somehow with the Joomla template I use.
Maybe also some improvements in VM also took part in resolving the issue.
Now I use VM 3.0.4.

Thanks again for the help!

Best regards,
Gerald