Skip to content

Instantly share code, notes, and snippets.

@willbroderick
Last active February 27, 2018 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willbroderick/63800a24500367089b811dee518c201e to your computer and use it in GitHub Desktop.
Save willbroderick/63800a24500367089b811dee518c201e to your computer and use it in GitHub Desktop.
Show 'Choose...' in a Symmetry theme with Sections
// 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('&nbsp;');
$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