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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 02:01 AM
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.
Any help would be appreciated. Thank you.
Kind Regards,
Raphael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 02:18 AM
Hi Raphael,
On catalog item, there is "No Order Now" field, you need to pull it on the form layout and make it true.
Regards,
Ajay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 02:29 AM
Hello Ajaykumar,
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 03:45 AM
Hi Raphael,
The solution to your problem where you want to Hide the 'Order Now' button.
The best way is to Check the 'No Order now' field to true and 'Use Cart Layout' field to false.
Briefly describing, on the service catalog page, i.e. writing "Maintain Item" on the left navigation and opening the particular item, we need to bring the 'No Order now' and 'Use Cart Layout' fields to the form layout.
Then we need to check the box for the 'No order now' field and un-check the box for the 'Use Cart layout' field.
Note: This can be configured separately or each catalog item.
Hope this helps. Please mark the answer Correct/Helpful based on the impact.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 07:01 PM
Hello Soumita,
This solution will permanently hide the 'Order Now' in the catalog form right? What I was trying to achieve is to hide the 'Order Now' button when 'Yes' is selected from a certain field and when the user selects 'No', the 'Order Now' button will re-appear again. Thank you.
Regards,
Raphael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 10:46 PM
Hi Raphael,
In order to achieve "to hide the 'Order Now' button when 'Yes' is selected from a certain field and when the user selects 'No', the 'Order Now' button will re-appear again", there can be two possible suggestions.
But at first to achieve what you require, you must define a default value for that field.
Now, you can either create an On-Change client script where you can check the default value is true or false and write an if else for "no_order_now" and "use_sc_layout" fields accordingly i.e. set these values to true or false accordingly in the script.
Or you can create a Before- Insert Business rule where again you can check for the default value and write the script.
If you require any further information regarding the script please let me know.
Please mark the answer as correct if it suffice your query.
Thanks.