For structured data purposes, I need to get all variants and their prices on the PROD page. I found this code sample:
https://docs.miva.com/code-samples/variant-price-range
However, it assumes pricing is being controlled by the variant product. These products have pricing set by master + attributes/options.
Any ideas? Basically I need a function that takes a master product and its variant, and returns the price. Alternatively, it could return a list of attributes/options that determine that variant, and I can calculate the price.
The closest I seem to be able to get is the variant_options member of the variant, but for products that depend on two or more attributes, that has the option codes separated by a delimiter. I'd prefer not to assume that the "_" is always used as the delimiter, but that's the only way I can think to split it out.
Hopefully I'm just overlooking the obvious.
Thanks,
Susan
https://docs.miva.com/code-samples/variant-price-range
However, it assumes pricing is being controlled by the variant product. These products have pricing set by master + attributes/options.
Any ideas? Basically I need a function that takes a master product and its variant, and returns the price. Alternatively, it could return a list of attributes/options that determine that variant, and I can calculate the price.
The closest I seem to be able to get is the variant_options member of the variant, but for products that depend on two or more attributes, that has the option codes separated by a delimiter. I'd prefer not to assume that the "_" is always used as the delimiter, but that's the only way I can think to split it out.
Hopefully I'm just overlooking the obvious.
Thanks,
Susan
Comment