This pull request refactors the Product Variants fieldtype to support field conditions.
I spent quite a lot of time trying to make the existing one-component-for-everything setup work but in the end, once I split each of the options into its own Vue component, it was easy to make field conditionals work.
Field conditionals use a mixin called FieldConditions, which checks this.value on the component for the different fields. This obviously wouldn't work with the "mega component" we had before.
In this PR, I've also made some minor UI tweaks following Statamic 4.
This pull request refactors the Product Variants fieldtype to support field conditions.
I spent quite a lot of time trying to make the existing one-component-for-everything setup work but in the end, once I split each of the options into its own Vue component, it was easy to make field conditionals work.
Field conditionals use a mixin called
FieldConditions
, which checksthis.value
on the component for the different fields. This obviously wouldn't work with the "mega component" we had before.In this PR, I've also made some minor UI tweaks following Statamic 4.
Fixes #913