Skip to main content
Tweeted twitter.com/StackMagento/status/997880069208059904
edited tags
Link
harri
  • 5.5k
  • 6
  • 46
  • 103
added 1 character in body
Source Link
Rafael Corrêa Gomes
  • 13.7k
  • 14
  • 91
  • 181

How to set drops downs on configurable products to be set to the first option rather than please select.

I have tried below code:

<script>
require(['jquery', 'jquery/ui'], function($){ 
  $('.product-add-form .field select').each(function(i, obj) {
    $(obj).find('option:eq(1)').prop('selected', true);
  });
});
</script>

However, this fails unless iI time it out a bit which feels messy. It also does not update price when using this method.

How to set drops downs on configurable products to be set to the first option rather than please select.

I have tried below code:

<script>
require(['jquery', 'jquery/ui'], function($){ 
  $('.product-add-form .field select').each(function(i, obj) {
    $(obj).find('option:eq(1)').prop('selected', true);
  });
});
</script>

However this fails unless i time it out a bit which feels messy. It also does not update price when using this method.

How to set drops downs on configurable products to be set to the first option rather than please select.

I have tried below code:

<script>
require(['jquery', 'jquery/ui'], function($){ 
  $('.product-add-form .field select').each(function(i, obj) {
    $(obj).find('option:eq(1)').prop('selected', true);
  });
});
</script>

However, this fails unless I time it out a bit which feels messy. It also does not update price when using this method.

added 373 characters in body
Source Link
harri
  • 5.5k
  • 6
  • 46
  • 103

How to set drops downs on configurable products to be set to the first option rather than please select.

I have tried below code:

<script>
require(['jquery', 'jquery/ui'], function($){ 
  $('.product-add-form .field select').each(function(i, obj) {
    $(obj).find('option:eq(1)').prop('selected', true);
  });
});
</script>

However this fails unless i time it out a bit which feels messy. It also does not update price when using this method.

How to set drops downs on configurable products to be set to the first option rather than please select.

How to set drops downs on configurable products to be set to the first option rather than please select.

I have tried below code:

<script>
require(['jquery', 'jquery/ui'], function($){ 
  $('.product-add-form .field select').each(function(i, obj) {
    $(obj).find('option:eq(1)').prop('selected', true);
  });
});
</script>

However this fails unless i time it out a bit which feels messy. It also does not update price when using this method.

Improving the question
Source Link
Rafael Corrêa Gomes
  • 13.7k
  • 14
  • 91
  • 181
Loading
Source Link
harri
  • 5.5k
  • 6
  • 46
  • 103
Loading