price not updating when changing quantity in service portal item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 07:44 AM
Hi All,
In SP Service Catalog Item, price is not updating as per quantity..Can someone suggest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 11:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2017 03:33 AM
Hi Kirti,
follow below steps.
1)clone "sc catalog item" widget as you can not update OOB widget. clone it and replace it on "sc_cat_item" page with page designer.
2) update select line on widget with highlighted text. i.e add ng-change attribute with function call.
3)define function like below in client script section of your widget.
c.updatePrice = function(){
var quantity = c.quantity;
var price = c.data.sc_cat_item._pricing.price;
var recprice = c.data.sc_cat_item._pricing.recurring_price;
var priceTotal = parseFloat(price*quantity).toFixed(2);
var recPriceTotal ;
if(c.data.sc_cat_item.recurring_price){
recPriceTotal = parseFloat(recprice*quantity).toFixed(2);
}
c.data.sc_cat_item.price = c.data.sc_cat_item.price.substring(0,1) + priceTotal;
c.data.sc_cat_item.recurring_price = c.data.sc_cat_item.recurring_price.substring(0,1) + recPriceTotal +" " + c.data.sc_cat_item._pricing.rfd;
}
let me know if any questions.
(please mark helpful/like/correct if it helps)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2017 03:58 AM
This isnt working as expected..it is changing my proce to 0$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2017 04:08 AM
i tested this in my instance..it is working fine..can you post your code.