Subversion Repositories SmartDukaan

Rev

Rev 16132 | Rev 16234 | 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>
24
              <span class="rupee"></span><span class="product_price"><?php echo intval($deal['available_price']);?></span>
25
              <?php if(isset($deal['cash_back_type']) && !empty($deal['cash_back_type']) && $deal['cash_back_type']!=0 && $deal['cash_back']>0):?>&nbsp;+
26
                <?php if($deal['cash_back_type'] == 2):?>
27
                  <span class="cashbackrupee"></span> <span class="cashback"><?php echo $deal['cash_back'];?></span>          
28
                <?php else:?>
29
                  <?php echo $deal['cash_back'];?> %
30
                <?php endif;?> 
31
                Cashback
32
              <?php endif;?>
33
            </div>
34
          </div> 
35
          <?php if(isset($deal['coupon']) && !empty($deal['coupon'])):?>
36
          <div class="text-small">
37
            Use Coupon <span class="red"><?php echo $deal['coupon'];?></span>
38
          </div>
39
          <?php endif;?>
40
          <?php if(isset($deal['codAvailable']) && !$deal['codAvailable']):?>
41
          <div class="text-small">
42
            (COD not available)
43
          </div>
16191 anikendra 44
          <?php else:?>
45
            <?php if($key!=0):?>
46
            <div class="text-small">
47
              (COD available)
48
            </div>
49
            <?php endif;?>
16098 anikendra 50
          <?php endif;?>
51
          <div class="dealoffer <?php if(!isset($deal['offer']) || empty($deal['offer'])):?>hidden<?php endif;?> row">
52
              <!-- <div class="col-xs-3 offerlabel">
53
                OFFER
54
              </div> -->
55
              <div class="<?php if(strlen($deal['offer'])>140):?>hasmoretext<?php endif;?> col-xs-12 offertext" data-fulltext="<?php echo $deal['offer'];?>">              
56
                <?php echo $this->Text->truncate($deal['offer'],140);?>
57
              </div>
58
          </div>  
15923 anikendra 59
        </div>
16098 anikendra 60
        <?php if($key==0):?>
61
        <div class="col-xs-2 pull-right product_actions">
62
          <ul class="list-unstyled">
63
            <li data-id="<?php echo $deal['_id'];?>" class="likedeal <?php if(isset($likedDeals[$deal['_id']])):?>active<?php endif;?>">
64
            </li>
65
            <li data-id="<?php echo $deal['_id'];?>" class="dislikedeal <?php if(isset($disLikedDeals[$deal['_id']])):?>active<?php endif;?>">
66
            </li>
67
          </ul>
16013 anikendra 68
        </div>
16127 anikendra 69
        <?php else:?>
70
        <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']);?>">
71
          <span class="pull-right arrowright"></span>
72
        </div>
16013 anikendra 73
        <?php endif;?>
16098 anikendra 74
      </div>       
75
      <?php endforeach;?>
76
    </div>  
13567 anikendra 77
  <?php endforeach;?>    
13719 anikendra 78
  <?php if($this->params->controller=='store_products'):?>
15026 anikendra 79
    <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 80
  <?php else:?>
15026 anikendra 81
    <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 82
  <?php endif;?>
13984 anikendra 83
<?php else:?>
15026 anikendra 84
  <?php if($page==1):?>
85
    <h4>The content you requested couldn't be found</h4>
86
    <div class="text-center">
87
      <button type="button" class="btn btn-xs btn-primary refresh">Retry</button>
88
    </div>
89
  <?php endif;?>
13719 anikendra 90
<?php endif;?>