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

How to hide 'order now' button dynamically in a catalog without using DOM Manipulation

Raphael Dizon
Mega Expert

Hello,

Does anyone have any alternatives of hiding the 'order_now' button in a catalog aside from using DOM Manipulations? I am aware that it's not best practice to use DOM Manipulation that's why I am trying to find other ways to hide the 'order now' button whenever a certain value in a field is selected. 

Here is a screenshot of my Catalog Client Script which is working but not a best practice.

find_real_file.png

Any help would be appreciated. Thank you.

Kind Regards,

Raphael

17 REPLIES 17

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Raphael,

You are not using DOM manipulation here. jQuery is being used which should be fine

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hello Ankur,

In our instance, there is a scan of update sets for possible best practice violations and the results that are showing are the ff:

find_real_file.png

Vishal Khandve
Kilo Sage

if you want to hide only for particular catalog item then you can user No Order Now checkbox 

 

if No Order Now is not on form then from form layout you can add to form.

then make Use of Cart Layout checkbox false and No Order Now checkbox false,

 

Thanks,

vishal

Hello Vishal,

I do not want to hide the 'order now' button permanently, I want it to hide based on a selected value in a field and to re-appear again once another value is selected from that same field. Thank you.