Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<?php $orderConfirmation = $recharge_orderconfirmation[0];?>
<div class="r-hldr"> 
  <div class="r-head">Recharge Details</div>
  <div class="r-cont clearfix">
    <div>Order Id</div>
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDisplayId; ?></div>
  </div>
  <div class="r-cont clearfix">
    <div>Status</div>
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeStatus; ?></div>
  </div>
  <div class="r-info">
    <div class="r-info-head clearfix">
      <?php if(strpos($recharge_orderconfirmation[0]->response->rechargeDisplayId, 'DTH') !== false){?>
      <div>Account Number</div>
      <?php } else{?>
      <div>Mobile Number</div><?php } ?>
      <div>Operator</div>
      <div>Amount</div>
    </div>
    <div class="r-info-body clearfix">
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDeviceNumber ?></div>
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeProvider ?></div>
      <div><?php echo $recharge_orderconfirmation[0]->response->totalAmount ?></div>
    </div>
  </div><!--o-info-->
  
</div><!--o-hldr-->
<script type="text/javascript">
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
  if(orderConfirmation != undefined){
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
    var orderId = orderConfirmation['response'].rechargeDisplayId;
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
/*
    _gaq.push(['_addTrans',
      orderId,                     // Transaction ID. Required.
      'Saholic',   // Affiliation or store name.
      amount,               // Grand Total.
      '0',                  // Shipping.
      '0',                     // Tax.
      "",
      "",
      "India"
    ]);
    _gaq.push(['_addItem',
      orderId,                     // Transaction ID. Required.     
      deviceNumber,                 // SKU/code.
      orderConfirmation['response'].rechargeProvider,    // Product name. Required.
      'Digital',         // Category or variation.
      amount,                 // Unit price.
      '1'                   // Quantity.
    ]);
     _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
*/
        ga('ecommerce:addTransaction', {
          'id': orderId,                     // Transaction ID. Required
          'affiliation': 'Saholic',   // Affiliation or store name
          'revenue': amount,               // Grand Total
          'shipping': '0',                  // Shipping
          'tax': '0'                     // Tax
        });
        // addItem should be called for every item in the shopping cart.
        ga('ecommerce:addItem', {
          'id': orderId,                     // Transaction ID. Required
          'sku': deviceNumber,                    // SKU/code
          'name': orderConfirmation['response'].rechargeProvider,                // Product name. Required
          'category': 'Digital',       // Category or variation
          'price': amount,                 // Unit price
          'quantity': '1'                   // Quantity
        });
        ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
  }
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  var value = localStorage.getItem('rechargeValue');
  if(parseInt(value) == 1){
        ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
        /*if(typeof _gaq != "undefined" && _gaq != null)  {
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Mobile-Result']);
      } */
  }else if(parseInt(value) == 2){
        /*if(typeof _gaq != "undefined" && _gaq != null)  {
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Recharge-Result']);
      } */
        ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
  }
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
  // }
</script>