Subversion Repositories SmartDukaan

Rev

Rev 16384 | Rev 16467 | 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>
16403 anikendra 18
          <div class="viewproduct <?php if(strlen(strip_tags($deal['tagline'],'<p>')) == strlen($deal['tagline'])):?>product_short_description<?php endif;?> <?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']);?>">
16098 anikendra 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'])):?>
16246 anikendra 25
              <div class="dp">DP <span class="cashbackrupee"></span> <?php echo $deal['dp'];?></div>
16234 anikendra 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">
16403 anikendra 55
              <div class="<?php if(strlen(strip_tags($deal['offer'],'<p>')) == strlen($deal['offer'])):?>offerhasnohtml<?php endif;?> col-xs-12 offertext" data-fulltext="<?php echo strip_tags($deal['offer']);?>">              
56
                <?php //echo $this->Text->truncate($deal['offer'],140);?>
57
                <?php echo $deal['offer'];?>
16098 anikendra 58
              </div>
59
          </div>  
15923 anikendra 60
        </div>
16098 anikendra 61
        <?php if($key==0):?>
62
        <div class="col-xs-2 pull-right product_actions">
63
          <ul class="list-unstyled">
64
            <li data-id="<?php echo $deal['_id'];?>" class="likedeal <?php if(isset($likedDeals[$deal['_id']])):?>active<?php endif;?>">
65
            </li>
66
            <li data-id="<?php echo $deal['_id'];?>" class="dislikedeal <?php if(isset($disLikedDeals[$deal['_id']])):?>active<?php endif;?>">
67
            </li>
68
          </ul>
16013 anikendra 69
        </div>
16127 anikendra 70
        <?php else:?>
71
        <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']);?>">
72
          <span class="pull-right arrowright"></span>
73
        </div>
16013 anikendra 74
        <?php endif;?>
16098 anikendra 75
      </div>       
76
      <?php endforeach;?>
77
    </div>  
16368 anikendra 78
  <?php endforeach;?>  
79
  <?php if(!$noscrolling):?>
80
    <?php if($this->params->controller=='store_products'):?>
81
      <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>
82
    <?php else:?>
83
      <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>
84
    <?php endif;?>
85
  <?php endif;?>
13719 anikendra 86
  <?php else:?>
16368 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;?>
93
  <?php endif;?>