Last active
April 13, 2018 22:37
-
-
Save riq363/5f88572917fcb8de41cd to your computer and use it in GitHub Desktop.
reset product options ecwid
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
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> | |
<script type="text/javascript"> | |
Ecwid.OnPageLoaded.add(function(page) { | |
function clearFields() { | |
jQuery("input.ecwid-productBrowser-details-optionTextField").val(""); | |
jQuery("select.ecwid-productBrowser-details-optionSelectBox").val($("option:first").val()); | |
jQuery("span.ecwid-productBrowser-details-optionCheckbox input").prop("checked", false); | |
jQuery("span.ecwid-productBrowser-details-optionRadioButton:first input").click(); | |
jQuery("input.ecwid-productBrowser-details-optionDateField").val(""); | |
jQuery("textarea.ecwid-productBrowser-details-optionTextArea").val(""); | |
} | |
if (page.type == "PRODUCT") { | |
jQuery("div.ecwid-AddToBagButton").click(function() { | |
clearFields(); | |
}); | |
jQuery("button.ecwid-productBrowser-details-addMoreButton").click(function() { | |
clearFields(); | |
}); | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. After the last update of ecwid, your code doesn`t work anymore :( could / would you fix it please?