Skip to main content

Questions tagged [variants]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Change product / variant price with custom module or plugin

I have recently upgraded a webshop to Craft 5 and Commerce 5. All products only have 1 variant. Prices are recalculated based on the exchange rates of gold and silver. Since Commerce 5 does not ...
Matthias's user avatar
  • 301
0 votes
0 answers
14 views

Updating Variant SKU

I'm trying to update the variant SKUs of existing products. I'm using the supplier SKU field as a unique identifier, but I get this error every time I run the import. I'm only populating the SKU field ...
Jason Dane Cutamora's user avatar
1 vote
1 answer
42 views

Category as variant

In Products (Craft Commerce), I've set custom fields. Some are texts, some are related to a Category. Actually, there's 2 different categories per variant... In order to draw the fields, I need to ...
Sylvain Tremblay's user avatar
0 votes
0 answers
175 views

Craft Commerce variants and stock limit

I'm working on solution that shows product variants with ability to select attributes in the front end. Now I have code like this: {% set colour = colour ?? [] %} {% set length = length ?? [] %} {% ...
Lukas Snarskis's user avatar
1 vote
1 answer
492 views

Eager loading of variant images

In a commerce store that I'm trying out, my product variants have a variant image field. I need to get an array of all the variant images in my product template. I know I can do something like {% set ...
Augustine Calvino's user avatar
2 votes
1 answer
212 views

Multi-attribute product variants

I'm basically looking for a more up-to-date way to do this: https://www.vaersaagod.no/en/multi-attribute-variant-selection-in-craft-commerce So that I can allow users to select color and size in two ...
supazu's user avatar
  • 526
2 votes
1 answer
86 views

Is there a way to get a variants stock quantity in commerce?

Like the question says. I know you can check if a variant is "in stock" with v.hasStock, but is there a way to pull the current stock quantity value? In my particular situation I would like ...
Jeff Irwin's user avatar
1 vote
1 answer
94 views

Craft Commerce: fixed product variants/multiplier

We have a client that is selling products with fixed rate variants. In other words so that the base cost is the only price defined whilst others are based on a globally defined multiplier, eg. 1.5x or ...
Cole Henley's user avatar
  • 1,741
1 vote
0 answers
263 views

Adding Product Variant and Related Product to the cart together on Craft Commerce 2

I want to add a product variant as well as a related product (chosen from a select list) together when the user clicks the add to cart button. I can see you can add multiple products together with ...
Terry Upton's user avatar
  • 1,894
2 votes
1 answer
291 views

Get and display a product's variant fields in twig

I'm working on a product template that can display products of any type. Various product types have varying numbers of variant fields each with their own options as other products. (All of my variant ...
Mark J. Reeves's user avatar
1 vote
1 answer
713 views

Get only enabled variants of a product

I would like to get all enabled variants for a product. I refer to the following question, where a method for limiting a for-loop is given: Disabled product variant still shows in {% for %} loop In ...
Mitchell's user avatar
2 votes
1 answer
289 views

Order products by lowest product variant

Currently using Craft Commerce 2. I was wondering if it's possible to order products by the lowest priced variant. I have tried something along the lines of this, but it doesn't do anything ...
Amy's user avatar
  • 407
1 vote
1 answer
247 views

Accessing Commerce product variant dimensions in the template

I have been unable to locate anything in the docs or any questions on here regarding how to print the dimensions associated with a variant in the template. All I have managed to find is how to print ...
Jay's user avatar
  • 1,042
1 vote
0 answers
47 views

Product variant association

On my Products details page I have 2 selects. The 1st select list out the Primary variants. Based on the selected Primary variant the 2nd select is auto-completed in with Secondary variants that have ...
Tad Ward's user avatar
  • 317
1 vote
0 answers
86 views

Creating variants

I need to create variants for my entries ( the entry type is Product but I'm not on Craft Commerce ). The variants have a number of features. Those features may change between products ( ex. variants ...
Alessio Breviglieri's user avatar