This document offers the basic knowledge for installing , configuring and using the dependent custom fields for all plugin. This document is copyrighted © 2019-2023 breakdesigns.net. The document is licensed under the terms of Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License [http://creativecommons.org/licenses/by-nc-nd/3.0/]. You can distribute it freely as long as you do not modify it and state its source and/or author. You cannot use this document or any portion of it for commercial purposes. If you require such use, for example to deliver it to your clients as part of your site building service, please email the author in order to acquire such a license and the source to this document.
MySQL 5 (InnoDB datbase engine)
Go to Components > Virtuemart > Custom Fields and press New. Then as Custom Field Type select “Plug-ins”. Fill in the rest fields till the end of the page.
The Is a list field has to be disabled
In the “Select a plug-in” select “Dependent Custom Fields For All”
After selecting the plugin type, the parameters of that plugin will be loaded.
The correct configuration of the plug-in is essential to the plug-in's behavior in the back-end and the front-end of your site. So it follows an explanation of the settings found here.
- Parent Custom Field: The custom field upon which this one depends.
If this is the 1st level/root custom field, leave this field empty.
- Data type: This is used to validate that the inserted data will be of a specific type.
- String/Text allows any input
- Color Hex. (Hexadecimal) allows only colors in hexadecimal format.
If you select this, a color picker popup will be displayed when you will try to insert a new color.
- Integer Number allows only integers e.g. 10
- Float Number allows decimal numbers e.g. 10.45
- Display type: It defines how the custom field will be displayed in the front-end of the site i.e. Buttons ,Color Buttons, Drop-down lists, etc.
- Required: Leaves the field without selection and prompts the user to select an option if he/she tries to add the product to the cart.
- Price Variant: Set this to Yes only if your custom field values will affect the price of the product.
- : In case you assigned a lot of custom field values to your products, you are advised to display them only in the details page. This way your category pages will be lighter and faster.
- Display Price : This setting has meaning only if the custom field is price variant.
It indicates how the price of each custom value will be displayed in the front-end of the site.
- Values : This section displays all the values of that custom field. You can insert the values you intent to use now or later from within the product form.
You are advised to first save your custom field and then insert the values. This way you will be able to take into account the selected parameters.
If your custom field has a parent, you have to select a parent value when you add a new value.
After the creation of the custom field lets go to assign it to a product.
Select a product and go to the Custom Fields Tab.
There from the Custom Field Type list, select the custom field you have created previously.
You have to assign only the last level custom field. The parent custom fields will be auto-assigned after saving the product.
If any value has been assigned to that custom field previously, you will see them in the list.
You can select the existing values, insert new values or do both.
If the custom field is price variant, only 1 value can be set per row.
You have to insert the custom field multiple times to the product, to set multiple values.
Currently only your last level custom fields can be used as price variants.
Can i use the plugin together withe the Custom Fields For All plugin ?
- This plugin is an advanced version of the Custom Fields For All plugin. You are adviced not to use custom fields from both plugins in the same product.
Since both plugins offer quite the same functionalities (except the dependencies) you are advised to use one of them in a product, after configuring it accordingly.
- If you have already installed the Custom Fields For All plugin and you want to use the Dependent Custom Fields For All as well, you have to upgrade your Custom Fields For All to a version equal or higher than 4.0.0.
The dependency does not work in my site's front-end, why ?
Please make sure of the following:
- The custom fields are assigned in the correct order in the product.
If you only assign the last level custom field to your product and save it, all the parent custom fields will be automatically assigned to that product and saved in the proper order.
But if you move the custom fields, make sure that you keep the order from parent to child custom field.
- There is no other custom field between them.
- All of the dependent custom fields have the settings Cart Input and Cart Attribute enabled.
The price update does not work properly in my site's front-end, why ?
Since the plugin auto-generates the parent custom fields, you can only use the last level custom fields as price variants.
If you are setting prices to the last level, the price can update, in the product page but the selected custom fields (in the last level) are not yet visible.
To avoid that, you ca set them as "required" from the custom field's settings. This way the last level custom fields, will not have a default selection .