- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 07:36 AM
Hello,
I would like to check the value of the quantity selector box on a catalog item page. How can I access this value in a client script? Screenshot attached below.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 11:39 PM
Hello ,
You can get it in client script; you just have to update the script mentioned below .
You have to make the changes in the function c.updateQuantity and you have to use c.quantity to get the selected value
Need To Change :
OutPut:
Mark It Correct If it's helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:07 PM
can u tell what u actually need to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 02:47 PM
Hi @cfraser ,
You can access the field with backend name as "quantity" for example i created a onload client script and added the quantity in the alert so could you please tell what is your exact requirement like what you want to do with the quantity value ?
Client script:
function onLoad() {
var quantity = g_form.getValue('quantity');
alert("Quantity is : "+ quantity);
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 05:17 PM
This will work only on stand-alone Catalog Items (not Order Guides) and if the OOB Catalog Item widget structure is in place:
function onChange (control, oldValue, newValue, isLoading) {
var scope = top.angular.element('[id="sc_cat_item"]').scope();
var quantity = scope.c.quantity;
alert(quantity);
}
I'm showcasing an onChange Catalog Client script, but other types will work the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 11:39 PM
Hello ,
You can get it in client script; you just have to update the script mentioned below .
You have to make the changes in the function c.updateQuantity and you have to use c.quantity to get the selected value
Need To Change :
OutPut:
Mark It Correct If it's helpful