<?php
  /**
   * Cart
   *
   * @package Wojo Framework
   * @author wojoscripts.com
   * @copyright 2017
   * @version $Id: cart.tpl.php, v1.00 2017-05-05 10:12:05 gewa Exp $
   */
  if (!defined("_WOJO"))
      die('Direct access to this location is not allowed.');
?>
<?php if(!$this->data):?>
<div class="item">
  <div class="content">
    <p class="wojo semi text content-center"><?php echo Lang::$word->FRONT_CART_EMPTY;?></p>
  </div>
</div>
<?php else:?>
<?php $total = 0;?>
<?php foreach($this->data as $xrow):?>
<?php $total += ($xrow->total * $xrow->items);?>
<div class="item">
  <img class="wojo small basic image" src="<?php echo Product::hasThumb($xrow->thumb, $xrow->pid);?>" alt="">
  <div class="content">
    <div class="header truncate"><a href="<?php echo Url::url('/product', $xrow->slug);?>"><?php echo $xrow->title;?></a>
    </div>
    <div class="wojo semi small text"><?php echo $xrow->items;?> x <?php echo Utility::formatMoney($xrow->total);?></div>
  </div>
  <?php /*?>  <div class="content shrink">
    <a data-id="<?php echo $xrow->pid;?>" class="half-left-padding deleteItem"><i class="icon inverted delete"></i></a>
  </div><?php */?>
</div>
<?php endforeach;?>
<div class="item">
  <div class="content content-center">
    <div class="wojo left labeled fluid button">
      <span class="wojo basic right pointing label">
      <?php echo Utility::formatMoney($total);?>
      <small>
      <?php if(App::Core()->enable_tax) echo '+ ' . Lang::$word->TAX;?>
      </small>
      </span>
      <a href="<?php echo Url::url('/cart');?>" class="wojo primary fluid button">
        <?php echo Lang::$word->FRONT_VIEW_CART;?>
      </a>
    </div>
  </div>
</div>
<?php endif;?>