logo

NJP

Hiding the shopping cart in ESS

Import · Aug 10, 2015 · article

When a user logs in to ESS Catalog. They see an annoying 'Empty' Shopping cart on the page, which most of the clients request to be hidden.

Below is the code that helps achieve that.

Eureka: Update the UI page "com.glideapp.servicecatalog_category_view"

Step 1. System UI > UI Pages > Name = com.glideapp.servicecatalog_category_view

Step 2. find the below mentioned code:

<g2:evaluate var="jvar_cart_style" expression=" var cart_style = ''; var cart = GlideappCart.getCartForRhino();

if ( !cart.getCartItems().hasNext() ${AMP}${AMP} !SNC.CatalogCMS.isCMSSite() )

cart_style='display:none';

cart_style;

"/>

/j2:if

Step 3. Replace if ( !cart.getCartItems().hasNext() ${AMP}${AMP} !SNC.CatalogCMS.isCMSSite() ) with if (!cart.getCartItems().hasNext())

Step 4 . Save and test the changes.

Fuji: comment out the isCMSSite() check(as below) in UI Page 'com.glideapp.servicecatalog_category_view'.

<!-- -->
/j2:if
<!-- /j2:if -->
/j2:if

Its lines of code 135 and 139.

View original source

https://www.servicenow.com/community/new-york-city-snug/hiding-the-shopping-cart-in-ess/ba-p/2292200