How to set pre-defined "Quantity" in a Catalog item through script?

Puja7
Kilo Explorer

How to set quantity as "2" for a particular catalog item.

find_real_file.png

g_form.setValue("quantity",2) = this is not working 

1 ACCEPTED SOLUTION

With the above code it will work in the Native Ui, for service portal you may have to do DOM manipulation

View solution in original post

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

Hello,

If you are using onload client script please use below:-

 

function onLoad() {
var number=5;
g_cart.setQuantity(number);

}

 

Please mark answer correct/helpful based on impact.

This code is not working on portal.

Please suggest me

Puja7
Kilo Explorer

I have tried your code but this is not working as well.

this below error is showing 

find_real_file.png

With the above code it will work in the Native Ui, for service portal you may have to do DOM manipulation