VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Greg P on August 04, 2012, 19:59:56 PM

Title: Custom Field for Parent ONLY?
Post by: Greg P on August 04, 2012, 19:59:56 PM
I've managed to create a custom field type based on "specification", but ONLY want it to be used on Parent Products.

Adding it to the parent works just fine, but when I go to maintain a Child of that parent, that custom field is also available to that Child.  I've tried removing it, but it persistently returns.  I've also notice a checkbox on the Child version of the custom field that asks "Overwrite plugin values of the parent", so VM clearly knows that it's loading a custom field from a parent.

According to "http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_product_customfields (http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_product_customfields)":
QuoteCustom fields with no Cart Attribute:
(Same as product types in VM1)
I've insured that it is NOT a Cart Attribute.

In VM1, you could assign a product type to a parent, and it had no affect on it's children -
Is that no longer the case? ???
Do all children inherit parent custom fields now?  :'(

Thank you in advance. :)
Title: Re: Custom Field for Parent ONLY?
Post by: philipperunza on September 11, 2012, 09:36:15 AM
hie

i have the same problem that you , i am unable to attribute a custom field to a child product i find this post


http://forum.virtuemart.net/index.php?topic=98648.0

Title: Re: Custom Field for Parent ONLY?
Post by: shem_lexluger on November 09, 2012, 20:50:03 PM
Custom fields are purposely disabled for Child products I'm not sure why. But to enable it, you just need to edit a core file.

administrator/components/com_virtuemart/models/customfields.php
Line 1393:
if (!$isChild) {

Simply comment out the if statement and the closing curly braces. Not the whole if block, just the if statement.


VM2.0.12f
Title: Re: Custom Field for Parent ONLY?
Post by: ultimamedia on March 18, 2014, 17:12:31 PM
Sorry to drag this thread up but i feel its still very relevant that 18 months later this still hasnt been fixed, does anyone know what the core fix will be for version 2.0.26 as this above fix doesnt work/exist in later versions of VM2.

Chris
Title: Re: Custom Field for Parent ONLY?
Post by: balai on March 18, 2014, 18:55:05 PM
Just go to the child product and click/check the overwrite custom fields checkboxe on top of the custom fields tab
Title: Re: Custom Field for Parent ONLY?
Post by: ultimamedia on March 19, 2014, 09:59:32 AM
Hi Balai - do you mean overwrite parent? you cant do this as it then stops the child selection cart attribute from working.
Title: Re: Custom Field for Parent ONLY?
Post by: balai on March 19, 2014, 16:34:50 PM
Sorry i don't get it

You said
Quotebut ONLY want it to be used on Parent Products

That means that you want your child products to use their own custom fields ignoring completely the parent. Right?