News:

Support the VirtueMart project and become a member

Main Menu

Custom Field for Parent ONLY?

Started by Greg P, August 04, 2012, 19:59:56 PM

Previous topic - Next topic

Greg P

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":
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. :)

philipperunza

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


shem_lexluger

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

ultimamedia

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

balai

Just go to the child product and click/check the overwrite custom fields checkboxe on top of the custom fields tab

ultimamedia

Hi Balai - do you mean overwrite parent? you cant do this as it then stops the child selection cart attribute from working.

balai

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?