<?php
/**
 * @package J2Store
 * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
 * @license GNU GPL v3 or later
 */
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
$nullDate = JFactory::getDbo( )->getNullDate();
?>
<?php if($vars->pricing_list): ?>
<div class="product-qty-discount">
	<ul class="j2store-product-qty-discount-pricing">
		<?php foreach($vars->pricing_list as $list):?>
		<li class="j2store-app-qty-discount-pricing-list">
			<?php echo JText::sprintf('PLG_J2STORE_APP_QTY_BUY' ,round($list->quantity_from));?>

			<?php echo JText::sprintf('PLG_J2STORE_APP_QTY_AND_ABOVE',J2Store::product()->displayPrice($list->price ,$vars->product,$vars->configparams)); ?>

			<?php if (!empty($list->date_from) && $list->date_from != $nullDate ): ?>
				<?php $from_date = JHTML::_('date',$list->date_from,$vars->date_format);?>
			<?php echo JText::sprintf('PLG_J2STORE_APP_QTY_FROM',$from_date);?>
				<?php if (!empty( $list->date_to)  && $list->date_to != $nullDate ):?>
			<?php $to_date = JHTML::_('date',$list->date_to,$vars->date_format);?>
				<?php echo JText::sprintf('PLG_J2STORE_APP_QTY_TO',$to_date);?>
				<?php endif;?>
			<?php endif;?>
		</li>
		<?php endforeach?>
	</ul>
</div>
<?php endif;?>