| Line 55... |
Line 55... |
| 55 |
});
|
55 |
});
|
| 56 |
};
|
56 |
};
|
| 57 |
function getCouponText(coupon){
|
57 |
function getCouponText(coupon){
|
| 58 |
return "<span class='red'>"+coupon+"</span>";
|
58 |
return "<span class='red'>"+coupon+"</span>";
|
| 59 |
};
|
59 |
};
|
| - |
|
60 |
function getGrossPriceText(gross_price,available_price){
|
| - |
|
61 |
return "(<span class='red'>"+gross_price+"</span> - Paytm cashback <span class='red'>"+(gross_price-available_price)+"</span>)"
|
| - |
|
62 |
}
|
| 60 |
function fetchLivePrice(obj){
|
63 |
function fetchLivePrice(obj){
|
| 61 |
ga('send', 'event', 'liveprice', 'fetch',$('#bestpriceproductname').html());
|
64 |
ga('send', 'event', 'liveprice', 'fetch',$('#bestpriceproductname').html());
|
| 62 |
var properties = {};
|
65 |
var properties = {};
|
| 63 |
properties.bundle_id = String($(obj).data('bundle_id'));
|
66 |
properties.bundle_id = String($(obj).data('bundle_id'));
|
| 64 |
properties.product_name = String($('#bestpriceproductname').html());
|
67 |
properties.product_name = String($('#bestpriceproductname').html());
|
| Line 102... |
Line 105... |
| 102 |
minpriceindex = j;
|
105 |
minpriceindex = j;
|
| 103 |
}
|
106 |
}
|
| 104 |
if(response.products[i].tagline && response.products[i].tagline.length>0 && $('#productoneliner').html().length==0) {
|
107 |
if(response.products[i].tagline && response.products[i].tagline.length>0 && $('#productoneliner').html().length==0) {
|
| 105 |
$('#productoneliner').html(response.products[i].tagline).removeClass('hidden').show();
|
108 |
$('#productoneliner').html(response.products[i].tagline).removeClass('hidden').show();
|
| 106 |
}
|
109 |
}
|
| 107 |
variants.push({'name' : response.products[i].source_product_name, 'source_id' : response.products[i].source_id, 'available_price' : Math.round(response.products[i].available_price), 'url' : response.products[i].marketPlaceUrl,'source_product_name' : response.products[i].source_product_name,'id' : response.products[i]._id,'cash_back_type' : response.products[i].cash_back_type,'cash_back' : response.products[i].cash_back,'coupon': response.products[i].coupon,'codAvailable' : response.products[i].codAvailable,'offer' : response.products[i].offer});
|
110 |
variants.push({'name' : response.products[i].source_product_name, 'source_id' : response.products[i].source_id, 'available_price' : Math.round(response.products[i].available_price), 'url' : response.products[i].marketPlaceUrl,'source_product_name' : response.products[i].source_product_name,'id' : response.products[i]._id,'cash_back_type' : response.products[i].cash_back_type,'cash_back' : response.products[i].cash_back,'coupon': response.products[i].coupon,'codAvailable' : response.products[i].codAvailable,'offer' : response.products[i].offer,'gross_price' : response.products[i].gross_price});
|
| 108 |
}
|
111 |
}
|
| 109 |
j++;
|
112 |
j++;
|
| 110 |
}
|
113 |
}
|
| 111 |
if(variants.length>1){
|
114 |
if(variants.length>1){
|
| 112 |
variants.splice(minpriceindex,1);
|
115 |
variants.splice(minpriceindex,1);
|
| Line 122... |
Line 125... |
| 122 |
$('#couponcode-'+$(that).data('id')).show().find('span.red',0).html(getCouponText(response.products[minpriceindex]['coupon']));
|
125 |
$('#couponcode-'+$(that).data('id')).show().find('span.red',0).html(getCouponText(response.products[minpriceindex]['coupon']));
|
| 123 |
}
|
126 |
}
|
| 124 |
if(!response.products[minpriceindex]['codAvailable']){
|
127 |
if(!response.products[minpriceindex]['codAvailable']){
|
| 125 |
$('#codstatus-'+$(that).data('id')).show().removeClass('codstatus');
|
128 |
$('#codstatus-'+$(that).data('id')).show().removeClass('codstatus');
|
| 126 |
}
|
129 |
}
|
| - |
|
130 |
if(response.products[minpriceindex]['gross_price'] && response.products[minpriceindex]['gross_price'] > 0){
|
| - |
|
131 |
$('#gross_price-'+$(that).data('id')).show().removeClass('gross_price').html(getGrossPriceText(response.products[minpriceindex]['gross_price'],response.products[minpriceindex]['available_price']));
|
| - |
|
132 |
}
|
| 127 |
if(response.products[minpriceindex]['offer'].length>0){
|
133 |
if(response.products[minpriceindex]['offer'].length>0){
|
| 128 |
$('#itemoffer-'+$(that).data('id')).show().html(response.products[minpriceindex]['offer']);
|
134 |
$('#itemoffer-'+$(that).data('id')).show().html(response.products[minpriceindex]['offer']);
|
| 129 |
}
|
135 |
}
|
| 130 |
$('#sku-'+$(that).data('id')).data('id',response.products[minpriceindex]['_id']).data('source',response.products[minpriceindex]['source_id']).data('price',response.products[minpriceindex]['available_price']).data('url',response.products[minpriceindex]['marketPlaceUrl']).removeClass('hidden');
|
136 |
$('#sku-'+$(that).data('id')).data('id',response.products[minpriceindex]['_id']).data('source',response.products[minpriceindex]['source_id']).data('price',response.products[minpriceindex]['available_price']).data('url',response.products[minpriceindex]['marketPlaceUrl']).removeClass('hidden');
|
| 131 |
if(globalminprice != 9999999) {
|
137 |
if(globalminprice != 9999999) {
|
| Line 199... |
Line 205... |
| 199 |
if(minprice == variants[i].available_price) {
|
205 |
if(minprice == variants[i].available_price) {
|
| 200 |
var html = '<div class="clearfix varnts"></div><div class="col-xs-6 varnts text-small">'+variants[i].name+'</div><div class="col-xs-6 varnts viewproduct" data-source="'+variants[i].source_id+'" data-price="'+variants[i].available_price+'" data-url="'+variants[i].url+'" data-id="'+variants[i].id+'"><span class="cashbackrupee varnts text-right" ></span> <span class="storeminprice">'+variants[i].available_price+'</span><span class="cashbackamount">'+getcashbackstring(variants[i].cash_back_type,variants[i].cash_back)+'</span><span class="pull-right arrowright"></span>';
|
206 |
var html = '<div class="clearfix varnts"></div><div class="col-xs-6 varnts text-small">'+variants[i].name+'</div><div class="col-xs-6 varnts viewproduct" data-source="'+variants[i].source_id+'" data-price="'+variants[i].available_price+'" data-url="'+variants[i].url+'" data-id="'+variants[i].id+'"><span class="cashbackrupee varnts text-right" ></span> <span class="storeminprice">'+variants[i].available_price+'</span><span class="cashbackamount">'+getcashbackstring(variants[i].cash_back_type,variants[i].cash_back)+'</span><span class="pull-right arrowright"></span>';
|
| 201 |
} else {
|
207 |
} else {
|
| 202 |
var html = '<div class="clearfix varnts"></div><div class="col-xs-6 varnts text-small">'+variants[i].name+'</div><div class="col-xs-6 varnts viewproduct" data-source="'+variants[i].source_id+'" data-price="'+variants[i].available_price+'" data-url="'+variants[i].url+'" data-id="'+variants[i].id+'"><span class="cashbackrupee varnts text-right" ></span> <span>'+variants[i].available_price+'</span><span class="cashbackamount">'+getcashbackstring(variants[i].cash_back_type,variants[i].cash_back)+'</span><span class="pull-right arrowright"></span>';
|
208 |
var html = '<div class="clearfix varnts"></div><div class="col-xs-6 varnts text-small">'+variants[i].name+'</div><div class="col-xs-6 varnts viewproduct" data-source="'+variants[i].source_id+'" data-price="'+variants[i].available_price+'" data-url="'+variants[i].url+'" data-id="'+variants[i].id+'"><span class="cashbackrupee varnts text-right" ></span> <span>'+variants[i].available_price+'</span><span class="cashbackamount">'+getcashbackstring(variants[i].cash_back_type,variants[i].cash_back)+'</span><span class="pull-right arrowright"></span>';
|
| 203 |
}
|
209 |
}
|
| - |
|
210 |
if(variants[i].gross_price && variants[i].gross_price>0){
|
| - |
|
211 |
html += '<p class="text-small">'+getGrossPriceText(variants[i].gross_price,variants[i].available_price)+'</p>';
|
| - |
|
212 |
}
|
| 204 |
if(variants[i].offer.length>0){
|
213 |
if(variants[i].offer.length>0){
|
| 205 |
html += '<p class="text-small">'+variants[i].offer+'</p>';
|
214 |
html += '<p class="text-small">'+variants[i].offer+'</p>';
|
| 206 |
}
|
215 |
}
|
| 207 |
if(variants[i].coupon && variants[i].coupon.length>0){
|
216 |
if(variants[i].coupon && variants[i].coupon.length>0){
|
| 208 |
html += '<p class="text-small">Use Coupon <span class="red">'+variants[i].coupon+'</span></p>';
|
217 |
html += '<p class="text-small">Use Coupon <span class="red">'+variants[i].coupon+'</span></p>';
|