$ sign on catalog item

kgerman
Tera Contributor

How do I get the dollar sign symbol to show on my catalog item next to the price? Price.pngprice 2.png

3 REPLIES 3

Faiz Ahmed Moha
Giga Expert

Hi @kgerman 

 

A similar requirement was addressed in below post, Please refer this link.

https://www.servicenow.com/community/developer-forum/how-to-define-variables-of-type-price-in-the-se... 

 

Please Mark my response as 'Helpful' and 'Accept solution' if this has addressed your issue or provided the information you were seeking.

 

Regards

Faiz

Shoheb_IbaaBoss
Tera Guru

Hi,

please see my response below:

 

  • If there is an HTML or UI Macro field associated with the catalog item, open it for editing.

  • Add the following HTML or similar code to include the dollar sign symbol:

$<span id="price_field">{{price_field}}</span>

 

Replace price_field with the actual field or variable name representing the price.

 

Use JavaScript to manipulate the DOM and add the dollar sign symbol. For example:

function onLoad() {
var priceField = g_form.getControl('price_field');
if (priceField) {
var priceValue = g_form.getValue('price_field');
priceField.innerHTML = '$' + priceValue;
}
}

Replace price_field with the actual field or variable name representing the price.

 

Regards,

Shoheb

Amit Verma
Kilo Patron
Kilo Patron

Hi @kgerman 

 

Please check if the below links helps :

 

https://www.servicenow.com/community/now-platform-forum/need-to-show-prices-of-catalog-items-in-spec...

https://www.servicenow.com/community/developer-forum/how-to-show-next-to-price-on-a-catalog-item-on-...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.