Well, I dont get anything in my loop, what is required for a variant?
I have, like the demo site, variant groups => variant group => variant type
and in my product I have a variant tab where I can choose different colors and add name, stock etc. But somehow they don't connect to the GetVariants?
Thanks!
List all variants of a product
Hello,
Im trying to get a list of color variants specified on a product in the product list-view, I have tried to use:
But I dont get any data from it.
Thanks in advance. Cheers!
Hi Jim,
And you are sure that the Children all have variants and the variants are valid?
This code works on the demo website:
@foreach ( var variant in TC.GetVariants( 1, productPage, true ) ) {
}
Check it out here: https://demo.teacommerce.net/expensive-yachts/summer-yacht/
/Rune
Hi,
Well, I dont get anything in my loop, what is required for a variant? I have, like the demo site, variant groups => variant group => variant type and in my product I have a variant tab where I can choose different colors and add name, stock etc. But somehow they don't connect to the GetVariants? Thanks!
/Jim
Have you named your properties and doc types the same as in the demo website? It might be looking after the variant property in the wrong place.
And i guess you are using the "Tea Commerce: Variant Editor"? Just checking :)
/Rune
I have named the properties and doc types the same as in the demo. I also have been using The Tea Commerce Variant Editor! :)
if I try this:
I get:
Any ideas? :) Thanks!
/Jim
And what does your code look like? The one you're using to GetVariants.
Looks like the data is there.
Hello!
I managed to solve it...! I forgot to fill in the "Product variant property alias" in the Tea commerce settings.
Thanks for your help!
/Jim
Trying different things, but the same as the one in the demo:
/Jim
Great. Good work.
Cheers /Rune
is working on a reply...