Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Check Portal Cart before check out with OnSubmit client script

aneta_koleva
Tera Expert

I am having the following requirement: to have a portal with attached service catalog. I need to do prevalidate on the cart to check if the current user is having enough amount of money for the ordered cart total price.

I was planning to create an onSubmit client script for the sc_cart using GlideAjax in order to check the cart items and their price.

But it wasn't working.

I have read that client scripts are not working with portals and indeed I have added an onLoad client script on sc_cart table but nothing is happening on the portal but only on the table itself in a particular record: 

aneta_koleva_0-1679467141343.png

Portal: 

aneta_koleva_1-1679467201710.png

what can be done in my case? any ideas are welcome.

Mark my answer Helpful in case you find it as such.
1 ACCEPTED SOLUTION

aneta_koleva
Tera Expert

I have cloned the Shopping cart page's widget 'SC Shopping cart' (sc-shopping-cart-v2)

and done the behavior there.

Mark my answer Helpful in case you find it as such.

View solution in original post

5 REPLIES 5

aneta_koleva
Tera Expert

I have cloned the Shopping cart page's widget 'SC Shopping cart' (sc-shopping-cart-v2)

and done the behavior there.

Mark my answer Helpful in case you find it as such.

I didn't find it in my Instance(sc-shopping-cart-v2)
Is there any way to find it.

Here is the path: 

aneta_koleva_0-1683808917154.png

Or via the portal configuration: 

aneta_koleva_1-1683809011612.png

Choose Widget editor and then:

aneta_koleva_2-1683809098366.png

 

Mark my answer Helpful in case you find it as such.

Thanks for your answer. Can it be used in this place on the picture(sc-shopping-cart-v2)

catalog item ----Request method ----Request----cart

cart.png