Last active
February 27, 2018 17:38
-
-
Save willbroderick/63800a24500367089b811dee518c201e to your computer and use it in GitHub Desktop.
Show 'Choose...' in a Symmetry theme with Sections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy this to the very bottom of Assets/theme.js.liquid, below everything else in there | |
$(document).on('optionate', 'select[name="id"]', function(){ | |
var $this = $(this); | |
setTimeout(function(){ | |
if(!$this.closest('.product-detail').find('.option-selectors select option[value=""]').length) { | |
$this.closest('.product-detail').find('.option-selectors select').prepend('<option value="">Choose...</option>').val('').trigger('change'); | |
$this.closest('.product-detail').find('.price-area').html(' '); | |
$this.closest('.product-detail').find('.gallery .thumbnails a:first').trigger('click'); | |
} | |
}, 10); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment