Quote:
Originally Posted by Nick Mucetti
Is it possible make the Quantity box default to "2" on just one particular product?
|
Hi Nick,
Thanks for reaching us out!
Sure, it can easily be done by adding a special JavaScript code to the
page where your Ecwid store installed.
Since your store's added to a
Wix website, you should add the code to the "
Advanced settings" section of
Ecwid app for Wix. Here's the code:
Code:
<script type="text/javascript">
Ecwid.OnPageLoaded.add(function(page) {
if (page.type == "PRODUCT" && page.productId == PRODUCTID) { // Specify the product ID here
var qtyField = document.getElementsByClassName("ecwid-productBrowser-details-qtyTextField");
var qf = qtyField[0];
qf.value = 2; // Specify the default quantity here
}
});
</script>
Pay you attention to the "
PRODUCTID" string. Replace that string with the
product ID that you need. You can find the product ID in browser's address bar when you open a product for editing in the
Ecwid control panel → System Settings → Catalog → Products page (see the below screenshot):
And don't forget to change the default quantity value (it's marked in red).
Hope this helps!
In case there are any additional questions or if you need further assistance, feel free to ask.