The CreatorCon Call for Content is officially open! Get started here.

how to hide the button add to cart only in backend through client script

Fdeveloper
Kilo Guru

Hi,

i should hide the button add to cart only in the backend in the portal the button should be visible , i try it to check 

Hide 'Add to Cart' to true not working and i try it No cart it works the button is hiding but it also hidding from the portal 

i should hide the button through client script any suggestion please to resolve this issue 

19 REPLIES 19

Nishu Saini
Kilo Guru
Hi Please check this relevant article it may help to resolve the query https://community.servicenow.com/community?id=community_question&sys_id=5bba8fb6dbeb6380fb4ae15b8a9619f3 Please mark helpful if this resolves the issue.

Nishu Saini
Kilo Guru

Hi make isolate script as false in 'catalog client script" to work"

document.getElementById('oi_add_to_cart_button').style.visibility = 'hidden';

"

 

find_real_file.png

Please mark helpful if it resolves the issue!

 

Hi @Nishu Saini ,

i am not using catalog client script i am using client script it works in catalog client script but in client script don't work even oslate script is false

Vaishnavi Lathk
Mega Sage
Mega Sage

Hi,

For that you would require DOM manipulation but that is not recommended.

If you still want to go ahead refer these link(s) for sample script

How to disable Order Now and Add to Cart buttons based on some actions when user is submitting the r...

To Hide "Add to Cart " & "Order Now " Button using client script

Regards
Vaishnavi

 

 

Hi @Vaishnavi Lathkar ,

this solution work for me oly when i use catlog client script when i use client script don't work for me and i should use client script because i should hide button of 20 catalog item