Developer forum

Forum » Ecommerce - Standard features » Show color variants in lists

Show color variants in lists

Anders Ebdrup
Reply

Hi all,

 

I have a shop with variants on almost all products (color and size), and we have se display all the individual colors in the product list a separate products and make it possible to filter on both color and filter.

Do you have any experience of have this is done?

 

Best regards, Anders


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear DW,

 

Is this possible now?

 
Nicolai Pedersen
Reply

Can you add an expression like the one attached?

Capture.PNG
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Thanks for reply, but all my values are false. Please find this screen dump: https://www.screencast.com/t/SCduOAUw.

What is the condition for the having a true value?

 
Nicolai Pedersen
Reply

The first product in a language (ProductID and LanguageID) with a given variant option id in the variant combination (VariantID). Looking at the code, it might return false if the variant option is not translated to the language of the product record.

What version are you using? And have you configured the indexbuilder to only index master products?

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

I have found the reason why the values are not set; this is only done in the first indexing as this variable is not reinitialized:

Private FirstVariantInGroup As New HashSet(Of String)

 

And the code only marks an entry as the first if it is not found in the hashset:

                    If Not variantFirstOptions.ContainsKey(firstVariantOptionVariantGroupKey) Then
                        Dim isFirst As Boolean = False
                        If isExtended Then
                            If Not FirstVariantInGroup.Contains(firstVariantOptionKey) Then
                                isFirst = True
                                FirstVariantInGroup.Add(firstVariantOptionKey)
                            End If
                        End If
                        variantFirstOptions.Add(firstVariantOptionVariantGroupKey, isFirst)
                    End If

 

Can you please try to look into this? And hopefully make a quick fix? :-)

 

Best regards, Anders

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Did you have a chance to look into this issue?

 
Nicolai Pedersen
Reply

Hi Anders

I've got it reproduced and has fixed it in TFS#67640 coming with the next release of Dynamicweb.Ecommerce package.

BR Nicolai

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Thank you so much! :-) We are very impatient to get access to the new release. When do you expect a new package to be published?

Best regards, Anders

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

I can see that the initialization is still placed wrong. Right now it is placed inside: Private Sub HandleVariants(document As IndexDocument, variantId As String, languageId As String, productId As String, isExtended As Boolean), but it should be placed in: Public Overrides Sub Build(writer As IIndexWriter, tracker As Tracker).

With the latest implementation the variable is reinitialized for every variant...

 

Please also think about partial update of the index, and we need a setting only to index products in stock as we now display variants out of stock, but in the beginning correct placement of the initialization is most important.

 

Best regards, Anders

 

 

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

Any news regarding the latest bug here?

 
Vincent Gercke
Reply

+1

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Anders

The problem TFS#67640 "First variant in group field is indexed wrong when indexing after the first time of iisreset" has now been fixed in Package "Dynamicweb.Ecommerce" version 1.6.59

You are able to find this update in the backend Package update section.

Also the correction are part of the 9.6.14 and 9.7 release 

You are able to find these build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum