Advertisement
mahdirockr

Untitled

Sep 17th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. {% comment %}
  2. See https://docs.shopify.com/themes/customization/products/how-to-add-a-pick-an-option-to-drop-downs
  3. {% endcomment %}
  4.  
  5.  
  6. <script>
  7.  
  8. $(document).ready(function() {
  9. if( typeof(productOptions ) != "undefined" ){
  10. for(i=0;i<productOptions.length;i++) {
  11. $('.single-option-selector:eq('+ i +')')
  12. .filter(function() {
  13. return $(this).find('option').length > 1
  14. })
  15. .prepend('<option value="">Pick a ' + productOptions[i][i] + '</option>')
  16. .val('')
  17. .trigger('change');
  18. }
  19. }
  20. });
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement