[solved] Custom fields do not display in cart

Started by gba, December 15, 2014, 15:15:19 PM

Previous topic - Next topic

gba

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

Milbo

This is indeed strange. Which customfields are affected?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

balai

Check if your custom fields as enabled as "Cart Input" and "Cart Attribute" in the custom field's pages

gba

#3
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]

AH

reload the base frontend views and remove your overrides

Then start again!
Regards
A

Joomla 4.4.5
php 8.1

gba

Hi!

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

Kind regards,
Gerald

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gba

Hi!

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

Kind regards,
Gerald

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gba

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

gba

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

gba

#11
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

gba

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