Subversion Repositories SmartDukaan

Rev

Rev 10953 | Rev 11703 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10953 Rev 11325
Line 48... Line 48...
48
    a = el;
48
    a = el;
49
    b = e.currentTarget.children[1];
49
    b = e.currentTarget.children[1];
50
}
50
}
51
 
51
 
52
function checkShipping(){
52
function checkShipping(){
53
  debugger;
53
  
54
  var itemId ;
54
  var itemId ;
55
  var color = document.getElementById('color');
55
  var color = document.getElementById('color');
56
  if(color != null){
56
  if(color != null){
57
   itemId = (color.options[color.selectedIndex].value); 
57
   itemId = (color.options[color.selectedIndex].value); 
58
  }else{
58
  }else{
Line 61... Line 61...
61
  var pincode = document.getElementById('pincode').value;
61
  var pincode = document.getElementById('pincode').value;
62
  if(/^\d+$/.test(pincode) && pincode.length == 6){
62
  if(/^\d+$/.test(pincode) && pincode.length == 6){
63
    var url = base_url+'productinfo/getDeliveryDetails/'+itemId+'/'+pincode;
63
    var url = base_url+'productinfo/getDeliveryDetails/'+itemId+'/'+pincode;
64
  microAjax(url, function(res)
64
  microAjax(url, function(res)
65
    {
65
    {
66
      debugger;
66
      
67
        //console.log(res);
67
        //console.log(res);
68
      if(res!='')
68
      if(res!='')
69
      {
69
      {
70
        data = JSON.parse(res);
70
        data = JSON.parse(res);
71
        days = data.business_days;
71
        days = data.business_days;
Line 111... Line 111...
111
      }
111
      }
112
  }
112
  }
113
}
113
}
114
var checkPincode;
114
var checkPincode;
115
function updateColor(value){
115
function updateColor(value){
116
    debugger;
116
    
117
    checkPincode = true;
117
    checkPincode = true;
118
    if(document.getElementById('error').style.display == "block"){
118
    if(document.getElementById('error').style.display == "block"){
119
      document.getElementById('error').style.display = "none";
119
      document.getElementById('error').style.display = "none";
120
    }
120
    }
121
        for(i=0;i<items.length;i++){
121
        for(i=0;i<items.length;i++){
Line 163... Line 163...
163
              return false; 
163
              return false; 
164
          }
164
          }
165
        }
165
        }
166
      }
166
      }
167
function addToCart(){
167
function addToCart(){
168
  debugger;
168
  
169
  var itemId ;
169
  var itemId ;
170
  var color = document.getElementById('color');
170
  var color = document.getElementById('color');
171
  if(color != null){
171
  if(color != null){
172
   itemId = (color.options[color.selectedIndex].value); 
172
   itemId = (color.options[color.selectedIndex].value); 
173
  }else{
173
  }else{
Line 207... Line 207...
207
    var url = base_url+'cart/add/'+itemId+'/null'+'/'+itemName;
207
    var url = base_url+'cart/add/'+itemId+'/null'+'/'+itemName;
208
  }
208
  }
209
    //window.location.href = url;
209
    //window.location.href = url;
210
    microAjax(url, function(res)
210
    microAjax(url, function(res)
211
      {
211
      {
212
      debugger;
212
      
213
        if(res!='')
213
        if(res!='')
214
        {
214
        {
215
          debugger;
215
          
216
          data = JSON.parse(res);
216
          data = JSON.parse(res);
217
          if(data['addcart'][0].redirectUrl != undefined && data['addcart'][0].redirectUrl != ''){
217
          if(data['addcart'][0].redirectUrl != undefined && data['addcart'][0].redirectUrl != ''){
218
            //window.history.replaceState("",document.title, base_url+'cart');
218
            //window.history.replaceState("",document.title, base_url+'cart');
219
            if(typeof _gaq != "undefined" && _gaq != null)  {
219
            if(typeof _gaq != "undefined" && _gaq != null)  {
220
              _gaq.push(['_trackEvent', 'Order', 'Add To Cart',itemId]);
220
              _gaq.push(['_trackEvent', 'Order', 'Add To Cart',itemId]);
Line 240... Line 240...
240
  if(document.getElementById('error').style.display == "block"){
240
  if(document.getElementById('error').style.display == "block"){
241
    document.getElementById('error').style.display = "none";
241
    document.getElementById('error').style.display = "none";
242
  }
242
  }
243
}
243
}
244
function trackAccessories(title){
244
function trackAccessories(title){
245
debugger;
245
 
246
if(typeof _gaq != "undefined" && _gaq != null)  {
246
if(typeof _gaq != "undefined" && _gaq != null)  {
247
    _gaq.push(['_trackEvent', 'Widget', 'Accessory Click', title]);
247
    _gaq.push(['_trackEvent', 'Widget', 'Accessory Click', title]);
248
  }
248
  }
249
}
249
}