| Line 80... |
Line 80... |
| 80 |
var globalminoffer = '';
|
80 |
var globalminoffer = '';
|
| 81 |
var calls = [];
|
81 |
var calls = [];
|
| 82 |
var priceRange = "";
|
82 |
var priceRange = "";
|
| 83 |
var saholic_cash = "";
|
83 |
var saholic_cash = "";
|
| 84 |
var globalminpriceshow;
|
84 |
var globalminpriceshow;
|
| - |
|
85 |
var useroffertext = "";
|
| 85 |
$('.storeminprice').each(function(){
|
86 |
$('.storeminprice').each(function(){
|
| 86 |
var temp = {'sort':$(this).data('searchorder'),'val':$(this)};
|
87 |
var temp = {'sort':$(this).data('searchorder'),'val':$(this)};
|
| 87 |
calls.push(temp);
|
88 |
calls.push(temp);
|
| 88 |
});
|
89 |
});
|
| 89 |
calls = sortByKey(calls,'sort');
|
90 |
calls = sortByKey(calls,'sort');
|
| Line 142... |
Line 143... |
| 142 |
// priceToCompare = response.products[i].gross_price;
|
143 |
// priceToCompare = response.products[i].gross_price;
|
| 143 |
priceToCompare = response.products[i].netPriceAfterCashBack;
|
144 |
priceToCompare = response.products[i].netPriceAfterCashBack;
|
| 144 |
priceToShow = response.products[i].gross_price;
|
145 |
priceToShow = response.products[i].gross_price;
|
| 145 |
}else{
|
146 |
}else{
|
| 146 |
if (response.products[i].source_id == 4 && response.products[i].cheapestBulkPrice != 0) {
|
147 |
if (response.products[i].source_id == 4 && response.products[i].cheapestBulkPrice != 0) {
|
| - |
|
148 |
useroffertext = response.offertext;
|
| 147 |
priceToCompare = response.products[i].cheapestBulkPrice;
|
149 |
priceToCompare = response.products[i].cheapestBulkPrice;
|
| 148 |
if(response.products[i].packQuantity>1){
|
150 |
if(response.products[i].packQuantity>1){
|
| 149 |
priceRange =(Math.round((response.products[i].cheapestBulkPrice/response.products[i].packQuantity) * 100) / 100) + " - "
|
151 |
priceRange =(Math.round((response.products[i].cheapestBulkPrice/response.products[i].packQuantity) * 100) / 100) + " - "
|
| 150 |
+ (Math.round((response.products[i].available_price/response.products[i].packQuantity) * 100) / 100) + " /- per unit";
|
152 |
+ (Math.round((response.products[i].available_price/response.products[i].packQuantity) * 100) / 100) + " /- per unit";
|
| 151 |
}
|
153 |
}
|
| Line 155... |
Line 157... |
| 155 |
+ Math.round(response.products[i].available_price);
|
157 |
+ Math.round(response.products[i].available_price);
|
| 156 |
}
|
158 |
}
|
| 157 |
|
159 |
|
| 158 |
|
160 |
|
| 159 |
} else {
|
161 |
} else {
|
| - |
|
162 |
useroffertext = response.offertext;
|
| 160 |
priceToCompare = response.products[i].netPriceAfterCashBack;
|
163 |
priceToCompare = response.products[i].netPriceAfterCashBack;
|
| 161 |
priceToShow = response.products[i].available_price;
|
164 |
priceToShow = response.products[i].available_price;
|
| 162 |
if(response.products[i].source_id == 4 && response.products[i].showNetPrice == 1 && response.products[i].cash_back >0 && response.products[i].cash_back_type > 0){
|
165 |
if(response.products[i].source_id == 4 && response.products[i].showNetPrice == 1 && response.products[i].cash_back >0 && response.products[i].cash_back_type > 0){
|
| 163 |
priceToShow = response.products[i].netPriceAfterCashBack;
|
166 |
priceToShow = response.products[i].netPriceAfterCashBack;
|
| 164 |
saholic_cash = '<span style="font-size:10px;color:#555;">(</span><span style="font-size:10px;color:red;">₹ '+response.products[i].available_price+'</span> <span style="font-size:10px;color:#555;">less </span>';
|
167 |
saholic_cash = '<span style="font-size:10px;color:#555;">(</span><span style="font-size:10px;color:red;">₹ '+response.products[i].available_price+'</span> <span style="font-size:10px;color:#555;">less </span>';
|
| Line 211... |
Line 214... |
| 211 |
if(inStock){
|
214 |
if(inStock){
|
| 212 |
$(that).html(minprice).siblings('.cashbackamount').html(getcashbackstring(response.products[minpriceindex].cash_back_type,response.products[minpriceindex].cash_back)).parent().addClass('viewproduct');
|
215 |
$(that).html(minprice).siblings('.cashbackamount').html(getcashbackstring(response.products[minpriceindex].cash_back_type,response.products[minpriceindex].cash_back)).parent().addClass('viewproduct');
|
| 213 |
|
216 |
|
| 214 |
if($(that).parent().data('storename') == "Saholic")
|
217 |
if($(that).parent().data('storename') == "Saholic")
|
| 215 |
{
|
218 |
{
|
| - |
|
219 |
if(useroffertext != "")
|
| - |
|
220 |
{
|
| - |
|
221 |
$(that).html(minprice).siblings('.userofferinlist').html('<div style="font-size:12px;color:maroon;"><a href='+apihost+'categories/target" style="color:maroon;"><span class="glyphicon glyphicon-tags"></span> <u>'+useroffertext+'</u></a></div>');
|
| - |
|
222 |
}
|
| 216 |
if(saholic_cash !=""){
|
223 |
if(saholic_cash !=""){
|
| 217 |
$(that).html(minprice).siblings('.cashbackamount').html("<div>"+saholic_cash+"</div>");
|
224 |
$(that).html(minprice).siblings('.cashbackamount').html("<div>"+saholic_cash+"</div>");
|
| 218 |
}
|
225 |
}
|
| 219 |
if (priceRange != "") {
|
226 |
if (priceRange != "") {
|
| 220 |
$(that).html(priceRange);
|
227 |
$(that).html(priceRange);
|
| Line 245... |
Line 252... |
| 245 |
$('#bestpricecontainer').removeClass('hidden');
|
252 |
$('#bestpricecontainer').removeClass('hidden');
|
| 246 |
|
253 |
|
| 247 |
if(typeof globalminsource!= "undefined") {
|
254 |
if(typeof globalminsource!= "undefined") {
|
| 248 |
if (globalminsource==4){
|
255 |
if (globalminsource==4){
|
| 249 |
// $('#bestprice').html(globalminprice);
|
256 |
// $('#bestprice').html(globalminprice);
|
| - |
|
257 |
if(useroffertext != "")
|
| - |
|
258 |
{
|
| - |
|
259 |
$('#useroffer').html('<div style="font-size:12px;color:maroon;"><a href='+apihost+'categories/target" style="color:maroon;"><span class="glyphicon glyphicon-tags"></span> <u>'+useroffertext+'</u></a></div>');
|
| - |
|
260 |
}
|
| - |
|
261 |
|
| 250 |
if (priceRange != "") {
|
262 |
if (priceRange != "") {
|
| 251 |
$('#bestprice').html(priceRange);
|
263 |
$('#bestprice').html(priceRange);
|
| 252 |
}
|
264 |
}
|
| 253 |
var value = globalminurl.substring(globalminurl.lastIndexOf('-') + 1);
|
265 |
var value = globalminurl.substring(globalminurl.lastIndexOf('-') + 1);
|
| 254 |
$('#beststorelink').attr('data-identifier', value);
|
266 |
$('#beststorelink').attr('data-identifier', value);
|