Skip to content

Instantly share code, notes, and snippets.

@riq363
Last active April 13, 2018 22:37
Show Gist options
  • Save riq363/5f88572917fcb8de41cd to your computer and use it in GitHub Desktop.
Save riq363/5f88572917fcb8de41cd to your computer and use it in GitHub Desktop.
reset product options ecwid
<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>
@deejayutz
Copy link

Hi. After the last update of ecwid, your code doesn`t work anymore :( could / would you fix it please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment