{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{if count($categoryProducts) > 0 && $categoryProducts !== false}
<section class="page-product-box blockproductscategory">
	<h2 class="title_main_section">{$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}</h2>
	<div id="productscategory_list" class="clearfix">
		<ul id="bxslider1" class="product_list grid clearfix">
		 {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct}
			<li class="ajax_block_product">
				<div class="product-container" itemscope itemtype="http://schema.org/Product">
				<div class="left-block">
					<div class="button-container">
						{if ($categoryProduct.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $categoryProduct.available_for_order && !isset($restricted_country_mode) && $categoryProduct.minimal_quantity <= 1 && $categoryProduct.customizable != 2 && !$PS_CATALOG_MODE}
							{if (!isset($categoryProduct.customization_required) || !$categoryProduct.customization_required) && ($categoryProduct.allow_oosp || $categoryProduct.quantity > 0)}
								{if isset($static_token)}
									<a class="white_btn button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart',false, NULL, "add=1&amp;id_product={$categoryProduct.id_product|intval}&amp;token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart' mod='productscategory'}" data-id-product="{$categoryProduct.id_product|intval}">
										<span>{l s='Add to cart' mod='productscategory'}</span>
									</a>
								{else}
									<a class="white_btn button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart',false, NULL, 'add=1&amp;id_product={$categoryProduct.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$categoryProduct.id_product|intval}">
										<span>{l s='Add to cart' mod='productscategory'}</span>
									</a>
								{/if}
							{else}
								<span class="button ajax_add_to_cart_button btn btn-default disabled">
									<span>{l s='Add to cart' mod='productscategory'}</span>
								</span>
							{/if}
						{/if}
						<a itemprop="url" class="white_btn button lnk_view btn btn-default" href="{$categoryProduct.link|escape:'html':'UTF-8'}" title="{l s='View'}">
							<span>{if (isset($categoryProduct.customization_required) && $categoryProduct.customization_required)}{l s='Customize' mod='productscategory'}{else}{l s='More' mod='productscategory'}{/if}</span>
						</a>
					</div>
					<div class="product-image-container">
						<a class="product_img_link"	href="{$categoryProduct.link|escape:'html':'UTF-8'}" title="{$categoryProduct.name|escape:'html':'UTF-8'}" itemprop="url">
							<img class="replace-2x img-responsive" src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($categoryProduct.legend)}{$categoryProduct.legend|escape:'html':'UTF-8'}{else}{$categoryProduct.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($categoryProduct.legend)}{$categoryProduct.legend|escape:'html':'UTF-8'}{else}{$categoryProduct.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />
						</a>
						{if isset($quick_view) && $quick_view}
						<a class="quick-view" href="{$categoryProduct.link|escape:'html':'UTF-8'}" rel="{$categoryProduct.link|escape:'html':'UTF-8'}">
							<i class="font-eye"></i><span>{l s='Fast view' mod='productscategory'}</span>
						</a>
						{/if}
						{if ($categoryProduct.allow_oosp || $categoryProduct.quantity > 0)}
							{if isset($categoryProduct.new) && $categoryProduct.new == 1}
								<a class="new tag " href="{$categoryProduct.link|escape:'html':'UTF-8'}">
									<span class="new-label">{l s='New' mod='productscategory'}</span>
								</a>
							{/if}
							{if isset($categoryProduct.on_sale) && $categoryProduct.on_sale && isset($categoryProduct.show_price) && $categoryProduct.show_price && !$PS_CATALOG_MODE}
								<a class="tag sale" href="{$categoryProduct.link|escape:'html':'UTF-8'}">
									<span class="sale-label">{l s='Sale!' mod='productscategory'}</span>
								</a>
							{/if}
						{/if}
						{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($categoryProduct.show_price) && $categoryProduct.show_price) || (isset($categoryProduct.available_for_order) && $categoryProduct.available_for_order)))}
						{if isset($categoryProduct.available_for_order) && $categoryProduct.available_for_order && !isset($restricted_country_mode)}
							<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
								{if ($categoryProduct.allow_oosp || $categoryProduct.quantity > 0)}
								{elseif (isset($categoryProduct.quantity_all_versions) && $categoryProduct.quantity_all_versions > 0)}
									<span class="tag out">
										<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options' mod='productscategory'}
									</span>
								{else}
									<span class="tag out">
										<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock' mod='productscategory'}
									</span>
								{/if}
							</span>
						{/if}
					{/if}
						{hook h='displayProductListFunctionalButtons' product=$categoryProduct}
					</div>
					{hook h="displayProductDeliveryTime" product=$categoryProduct}
					{hook h="displayProductPriceBlock" product=$categoryProduct type="weight"}
				</div>
				<div class="right-block">
					<div class="rate_list_product">{hook h='displayProductListReviews' product=$categoryProduct}</div>
					<h5 itemprop="name">
						{if isset($categoryProduct.pack_quantity) && $categoryProduct.pack_quantity}{$categoryProduct.pack_quantity|intval|cat:' x '}{/if}
						<a class="product-name" href="{$categoryProduct.link|escape:'html':'UTF-8'}" title="{$categoryProduct.name|escape:'html':'UTF-8'}" itemprop="url" >
							{$categoryProduct.name|truncate:45:'...'|escape:'html':'UTF-8'}
						</a>
					</h5>
					{if (!$PS_CATALOG_MODE AND ((isset($categoryProduct.show_price) && $categoryProduct.show_price) || (isset($categoryProduct.available_for_order) && $categoryProduct.available_for_order)))}
					<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="content_price">
						{if isset($categoryProduct.show_price) && $categoryProduct.show_price && !isset($restricted_country_mode)}
							<span itemprop="price" class="price product-price">
								{if !$priceDisplay}
                                    {assign var=price value=substr($categoryProduct.price,0,strpos($categoryProduct.price,'.')+1)}
                                    {assign var=after_fix value=substr($categoryProduct.price,strpos($categoryProduct.price,'.')+1)}
                                {else}
                                    {assign var=price value=substr($categoryProduct.price_tax_exc,0,strpos($categoryProduct.price_tax_exc,'.')+1)}
                                    {assign var=after_fix value=substr($categoryProduct.price_tax_exc,strpos($categoryProduct.price_tax_exc,'.')+1)}
                                {/if}

        						{$currency->prefix}{$price}<sup>{$after_fix}</sup>{$currency->suffix}
								
								{if isset($categoryProduct.specific_prices) && $categoryProduct.specific_prices && isset($categoryProduct.specific_prices.reduction) && $categoryProduct.specific_prices.reduction > 0}
								{hook h="displayProductPriceBlock" product=$categoryProduct type="old_price"}
								<span class="old-price product-price">
									{displayWtPrice p=$categoryProduct.price_without_reduction}
								</span>
								{hook h="displayProductPriceBlock" id_product=$categoryProduct.id_product type="old_price"}
								{if $categoryProduct.specific_prices.reduction_type == 'percentage'}
									<span class="price-percent-reduction">-{$categoryProduct.specific_prices.reduction * 100}%</span>
								{/if}
							{/if}
							{hook h="displayProductPriceBlock" product=$categoryProduct type="price"}
							{hook h="displayProductPriceBlock" product=$categoryProduct type="unit_price"}
						{/if}
							</span>
							<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
							
					</div>
					{/if}
				</div>
			</div><!-- .product-container> -->
			</li>
		{/foreach}
		</ul>
	</div>
</section>
{/if}