How to extend any method of a view – eg

_.extend(ProductViewsPriceView.prototype,{

               template: jj_productpriceview_pricemodule_tpl,

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

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

                              context.showOnSaleOrigPricelarge = show_onsale_orig_price;

                              return context;                                              

               })

});

Leave a comment

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