Article

Ecommerce: Product attribute variations dropdown is shown for product with no variations in product list widget

« Go Back

Information

 
Article Number000094329
EnvironmentProduct: Sitefinity
Version: 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description
When attributes are set to a product type (e.g. Size, Color) and there are products from the product type that do not have any variations for that attribute, the dropdown for the attribute is present in the product detail page with no options to select from.
Steps to Reproduce1. Create a new attribute (e.g. Size) and assign it to a certain content type
2. Create a few attribute values
3. Create two products - one with at least one variation based on the attribute and one without any variations
4. Browse the detail page for both products (Product list widget is used)

As a result: the dropdown with variations based on the attribute is shown for both products
Clarifying Information
Error Message
Defect/Enhancement NumberBug 259603
Cause
For more information about Bug 259603, see https://feedback.progress.com/Project/153/feedback/Details/259603
Resolution
Until the fix is available, use the workaround below.
Workaround
1. Go to Design > Widget Templates
2. Open the "Product Details" template (if a custom template is used for showing the detail information of a product, open the respective template) and add the following lines:
<script>
$(".sfproductOption > div > select").each((index, element) => {
  var sel = $(element);
  if(sel.find("option").length < 2)
  {
    sel.parent().parent().hide();
  }
});
</script>

 
Notes
Attachment 
Last Modified Date2/8/2019 3:20 PM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025