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

Hide the cart layout in Native UI and create a custom Submit button using macro

Community Alums
Not applicable

If you want to hide the complete right hand pane for order in Native UI

SanjayG_3-1705496277910.png

 

Below is the code configuration

SanjayG_0-1705495332423.png

 

Create a onload client script as below

function onLoad() {
adder.hide(); //Hides the right pane in catalog item while requesting
}

 

Note: I have created a custom submit button to submit the request.

Create a variable submit_button of type Custom, order of the variable should be highest so that it will be visible at the bottom

In the type specification under macro select the created macro- new_submit_button

SanjayG_1-1705495470178.png

 

Create a macro:

Name:new_submit_button

 

XML:

<j:jelly xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
    <button id="customSubmitButton" type="button">Submit</button>
	<style>
	 #customSubmitButton {
            background-color: #1f8476; /* Green background */
            color: white; /* White text */
		    padding: 4px 10px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin: 4px 2px;
            cursor: pointer;
            border-radius: 4px;
			border-color: #10463f;
		}
	</style>
    <script>
	
        document.getElementById('customSubmitButton').onclick = function() {
            // Custom submit logic here
		g_form.orderNow();
		
        };
    </script>
</j:jelly>

 

SanjayG_2-1705495508289.png

 

The configuration should look like the above.

 

Once done you can reload the catalog item page to check the same.

SanjayG_4-1705496446216.png

 

Mark this post as helpful if it has solved your query.

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Datta,

Can you please share the snippet of the onload client script.

 

Also please check the catalog fields for 'No order'

View solution in original post

2 REPLIES 2

Datta Gadekar
ServiceNow Employee
ServiceNow Employee

@Community Alums I have tried using this on Load. but it is not working. it is still showing "Order Now" Button.

adder.hide();

DattaGadekar_0-1714605252193.png

 

Community Alums
Not applicable

Hi Datta,

Can you please share the snippet of the onload client script.

 

Also please check the catalog fields for 'No order'