Created
September 26, 2017 09:10
-
-
Save andycole/83d1b173ba380236a65caedc45eeffb9 to your computer and use it in GitHub Desktop.
Code workarounds
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
<!-- Hide particular product in items to match on PDP --> | |
<!-- Inserted into Product description of master product --> | |
<script> | |
defer(function($){ | |
function hideSuspenders() { | |
var _sspndr = $('a:contains("Sexy Lace Suspender Belt")').closest('li') | |
var _sspndr2 = $('a:contains("Standalone Suspender Belt")').closest('li') | |
if ($('.product-top-content .color-swatch.black.selected').length) { | |
_sspndr.hide() | |
_sspndr2.show() | |
} else { | |
_sspndr.show() | |
_sspndr2.hide() | |
} | |
} | |
hideSuspenders(); | |
$(document).ajaxComplete(function(e, x, o) {if (o.url.indexOf('Product-Variation') >= 0 ) {hideSuspenders();}}); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment