3

You can do the following: {{ variant.stock }}


3

If you already have the product PHP $product = Product::find()->one(); $variants = ArrayHelper::filterByValue($product->variants, 'enabled', 1); Twig {% set product = craft.products.one() %} {% set variants = product.variants|filterByValue('enabled', "1") %} If you don't have the product Twig {% set variants = craft .commerce .variants ...


3

Dimensions are set and accessed individually: {% set variant = product.defaultVariant %} {{ variant.width }} {{ variant.height }} {{ variant.length }} {{ variant.weight }}


2

It looks like I'm trying to use variants the way options can be used. I'm going to go with options.


2

I managed to resolve this using the supersort plugin and using 'defaultPrice' instead of 'price'. Example below: {% set products = craft.products.type('accommodation').all() %} {% set order = products|supersort('sortAs', '{{ object.defaultPrice }}') %} {% for product in order %} // Products {% endfor %}


1

I'm not sure if the base cost is global across all products, or varies between products - but either way you could use an Adjuster module or plugin to modify the price of line items in the cart. That way you don't need to worry about creating any variants in the backend at all, and can store the price multipliers in Global fields if you want to. To my ...


Only top voted, non community-wiki answers of a minimum length are eligible