Subversion Repositories SmartDukaan

Rev

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

<!-- template for deals tab -->
<?php echo $this->element('unlikemodal');?>
<?php if(!empty($deals) && !empty($deals[0])):?>
    <?php foreach($deals AS $dealarray):?>
    <div class="row card">   
    <?php foreach ($dealarray as $key => $deal) :?>
    <?php if(empty($deal))continue;?>
    <?php //debug($deal);continue;?>
      <div class="subcard">
        <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']);?>">
          <?php if($key == 0):?>
          <img src="<?php echo $base_url;?>app/webroot/timthumb.php?src=<?php echo $deal['thumbnail'];?>&h=100" />
          <?php endif;?>
        </div>
        <div class="col-xs-6 <?php if($key == 0):?>productdetails<?php else:?>productsmalldetails<?php endif;?>" data-id="<?php echo $deal['_id'];?>">
          <?php if($key == 0):?>
          <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>
          <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']);?>">
            <?php echo $deal['tagline'];?>
          </div>
          <?php endif;?>
          <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']);?>">
            <div>
              <?php if(isset($deal['showDp']) && $deal['showDp']==1 && !empty($deal['dp'])):?>
              <div class="dp">DP Rs. <?php echo $deal['dp'];?></div>
              <?php endif;?>
              <span class="rupee"></span><span class="product_price"><?php echo intval($deal['available_price']);?></span>
              <?php if(isset($deal['cash_back_type']) && !empty($deal['cash_back_type']) && $deal['cash_back_type']!=0 && $deal['cash_back']>0):?>&nbsp;+
                <?php if($deal['cash_back_type'] == 2):?>
                  <span class="cashbackrupee"></span> <span class="cashback"><?php echo $deal['cash_back'];?></span>          
                <?php else:?>
                  <?php echo $deal['cash_back'];?> %
                <?php endif;?> 
                Cashback
              <?php endif;?>
            </div>
          </div> 
          <?php if(isset($deal['coupon']) && !empty($deal['coupon'])):?>
          <div class="text-small">
            Use Coupon <span class="red"><?php echo $deal['coupon'];?></span>
          </div>
          <?php endif;?>
          <?php if(isset($deal['codAvailable']) && !$deal['codAvailable']):?>
          <div class="text-small">
            (COD not available)
          </div>
          <?php else:?>
            <?php if($key!=0):?>
            <div class="text-small">
              (COD available)
            </div>
            <?php endif;?>
          <?php endif;?>
          <div class="dealoffer <?php if(!isset($deal['offer']) || empty($deal['offer'])):?>hidden<?php endif;?> row">
              <!-- <div class="col-xs-3 offerlabel">
                OFFER
              </div> -->
              <div class="<?php if(strlen($deal['offer'])>140):?>hasmoretext<?php endif;?> col-xs-12 offertext" data-fulltext="<?php echo $deal['offer'];?>">              
                <?php echo $this->Text->truncate($deal['offer'],140);?>
              </div>
          </div>  
        </div>
        <?php if($key==0):?>
        <div class="col-xs-2 pull-right product_actions">
          <ul class="list-unstyled">
            <li data-id="<?php echo $deal['_id'];?>" class="likedeal <?php if(isset($likedDeals[$deal['_id']])):?>active<?php endif;?>">
            </li>
            <li data-id="<?php echo $deal['_id'];?>" class="dislikedeal <?php if(isset($disLikedDeals[$deal['_id']])):?>active<?php endif;?>">
            </li>
          </ul>
        </div>
        <?php else:?>
        <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']);?>">
          <span class="pull-right arrowright"></span>
        </div>
        <?php endif;?>
      </div>       
      <?php endforeach;?>
    </div>  
  <?php endforeach;?>    
  <?php if($this->params->controller=='store_products'):?>
    <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>
  <?php else:?>
    <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>
  <?php endif;?>
<?php else:?>
  <?php if($page==1):?>
    <h4>The content you requested couldn't be found</h4>
    <div class="text-center">
      <button type="button" class="btn btn-xs btn-primary refresh">Retry</button>
    </div>
  <?php endif;?>
<?php endif;?>