Subversion Repositories SmartDukaan

Rev

Rev 16234 | Rev 16246 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13715 anikendra 1
<!-- template for deals tab -->
13682 anikendra 2
<?php echo $this->element('unlikemodal');?>
16098 anikendra 3
<?php if(!empty($deals) && !empty($deals[0])):?>
4
    <?php foreach($deals AS $dealarray):?>
5
    <div class="row card">   
6
    <?php foreach ($dealarray as $key => $deal) :?>
7
    <?php if(empty($deal))continue;?>
8
    <?php //debug($deal);continue;?>
9
      <div class="subcard">
10
        <div class="col-xs-4 productthumb viewproduct" data-id="<?php echo $deal['_id'];?>" data-url="<?php echo $deal['marketPlaceUrl'];?>" data-source="<?php echo $deal['source_id'];?>" data-price="<?php echo intval($deal['available_price']);?>">
11
          <?php if($key == 0):?>
12
          <img src="<?php echo $base_url;?>app/webroot/timthumb.php?src=<?php echo $deal['thumbnail'];?>&h=100" />
13
          <?php endif;?>
14795 anikendra 14
        </div>
16098 anikendra 15
        <div class="col-xs-6 <?php if($key == 0):?>productdetails<?php else:?>productsmalldetails<?php endif;?>" data-id="<?php echo $deal['_id'];?>">
16
          <?php if($key == 0):?>
17
          <h5 class="producttitle viewproduct" data-id="<?php echo $deal['_id'];?>" data-url="<?php echo $deal['marketPlaceUrl'];?>" data-source="<?php echo $deal['source_id'];?>" data-price="<?php echo intval($deal['available_price']);?>"><?php echo $deal['source_product_name'];?></h5>
18
          <div class="viewproduct product_short_description <?php if(!isset($deal['tagline'])):?>hidden<?php endif;?>" data-id="<?php echo $deal['_id'];?>" data-source="<?php echo $deal['source_id'];?>"  data-url="<?php echo $deal['marketPlaceUrl'];?>" data-price="<?php echo intval($deal['available_price']);?>">
19
            <?php echo $deal['tagline'];?>
13944 anikendra 20
          </div>
16098 anikendra 21
          <?php endif;?>
16132 anikendra 22
          <div <?php if(!empty($deal['coupon'])):?>style="margin:0 !important"<?php endif;?> class="product_prices viewproduct" data-id="<?php echo $deal['_id'];?>" data-source="<?php echo $deal['source_id'];?>" data-url="<?php echo $deal['marketPlaceUrl'];?>" data-price="<?php echo intval($deal['available_price']);?>">
16098 anikendra 23
            <div>
16240 anikendra 24
              <?php if(isset($deal['showDp']) && $deal['showDp']==1 && !empty($deal['dp'])):?>
16234 anikendra 25
              <div class="dp">DP Rs. <?php echo $deal['dp'];?></div>
26
              <?php endif;?>
16098 anikendra 27
              <span class="rupee"></span><span class="product_price"><?php echo intval($deal['available_price']);?></span>
28
              <?php if(isset($deal['cash_back_type']) && !empty($deal['cash_back_type']) && $deal['cash_back_type']!=0 && $deal['cash_back']>0):?>&nbsp;+
29
                <?php if($deal['cash_back_type'] == 2):?>
30
                  <span class="cashbackrupee"></span> <span class="cashback"><?php echo $deal['cash_back'];?></span>          
31
                <?php else:?>
32
                  <?php echo $deal['cash_back'];?> %
33
                <?php endif;?> 
34
                Cashback
35
              <?php endif;?>
36
            </div>
37
          </div> 
38
          <?php if(isset($deal['coupon']) && !empty($deal['coupon'])):?>
39
          <div class="text-small">
40
            Use Coupon <span class="red"><?php echo $deal['coupon'];?></span>
41
          </div>
42
          <?php endif;?>
43
          <?php if(isset($deal['codAvailable']) && !$deal['codAvailable']):?>
44
          <div class="text-small">
45
            (COD not available)
46
          </div>
16191 anikendra 47
          <?php else:?>
48
            <?php if($key!=0):?>
49
            <div class="text-small">
50
              (COD available)
51
            </div>
52
            <?php endif;?>
16098 anikendra 53
          <?php endif;?>
54
          <div class="dealoffer <?php if(!isset($deal['offer']) || empty($deal['offer'])):?>hidden<?php endif;?> row">
55
              <!-- <div class="col-xs-3 offerlabel">
56
                OFFER
57
              </div> -->
58
              <div class="<?php if(strlen($deal['offer'])>140):?>hasmoretext<?php endif;?> col-xs-12 offertext" data-fulltext="<?php echo $deal['offer'];?>">              
59
                <?php echo $this->Text->truncate($deal['offer'],140);?>
60
              </div>
61
          </div>  
15923 anikendra 62
        </div>
16098 anikendra 63
        <?php if($key==0):?>
64
        <div class="col-xs-2 pull-right product_actions">
65
          <ul class="list-unstyled">
66
            <li data-id="<?php echo $deal['_id'];?>" class="likedeal <?php if(isset($likedDeals[$deal['_id']])):?>active<?php endif;?>">
67
            </li>
68
            <li data-id="<?php echo $deal['_id'];?>" class="dislikedeal <?php if(isset($disLikedDeals[$deal['_id']])):?>active<?php endif;?>">
69
            </li>
70
          </ul>
16013 anikendra 71
        </div>
16127 anikendra 72
        <?php else:?>
73
        <div class="col-xs-2 pull-right viewproduct" data-id="<?php echo $deal['_id'];?>" data-source="<?php echo $deal['source_id'];?>" data-url="<?php echo $deal['marketPlaceUrl'];?>" data-price="<?php echo intval($deal['available_price']);?>">
74
          <span class="pull-right arrowright"></span>
75
        </div>
16013 anikendra 76
        <?php endif;?>
16098 anikendra 77
      </div>       
78
      <?php endforeach;?>
79
    </div>  
13567 anikendra 80
  <?php endforeach;?>    
13719 anikendra 81
  <?php if($this->params->controller=='store_products'):?>
15026 anikendra 82
    <p class="text-center"><a class="btn btn-primary infitescroller" href="/store_products/getdeals/?page=<?php echo $page+1;?>&sort=<?php echo $sort;?>&direction=<?php echo $direction;?><?php echo $filterstr;?>">Load More</a></p>
13719 anikendra 83
  <?php else:?>
15026 anikendra 84
    <p class="text-center"><a class="btn btn-primary infitescroller" href="/categories/getdeals/<?php echo $id;?>/?page=<?php echo ($page+1);?>&sort=<?php echo $sort;?>&direction=<?php echo $direction;?><?php echo $filterstr;?>">Load More</a></p>
13719 anikendra 85
  <?php endif;?>
13984 anikendra 86
<?php else:?>
15026 anikendra 87
  <?php if($page==1):?>
88
    <h4>The content you requested couldn't be found</h4>
89
    <div class="text-center">
90
      <button type="button" class="btn btn-xs btn-primary refresh">Retry</button>
91
    </div>
92
  <?php endif;?>
13719 anikendra 93
<?php endif;?>