To change $ to USD in entry point file

Currency by default it will be in $ symbol if it is given USD in design we need to change as per requirement so directly we cannot change it in tpl file as it will be comming from source

Then the view need to be extend in entry point file to redirect $ to USD

 _.extend(CartItemSummaryView.prototype, {

                    // template: jj_savelater_cart_detailed_tpl,

                    getContext: _.wrap(CartItemSummaryView.prototype.getContext, function (fn) {

                        var originalRet = fn.apply(this, _.toArray(arguments).slice(1));                    

                        console.log("originalRet in CartItemSummaryView", originalRet)

                        var val=originalRet.totalFormatted;

                        console.log("val in CartItemSummaryView", val)

                        var results = val.split('$');

                        console.log("results in CartItemSummaryView", results[1])

                        originalRet.totalvalue=results[1]+'USD';

                        // originalRet.showformobile=showmobiletext;

                        // originalRet.showfordesktop=showfordesktop;

                        console.log("originalRet after", originalRet)

                        return originalRet;



                    })

                })

By this we can change total value along with symbol required or suggested in design

Leave a comment

Your email address will not be published. Required fields are marked *