{*
* 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
*}

<div class="c_item">
	<div class="product-container">
		<div class="left-block">
			<div class="button-container">
				{if $show_add_to_cart && $item.available_for_order && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}		
					<a class="white_btn button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart',false, NULL, "add=1&amp;id_product={$item.id_product|intval}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='To cart' mod='multicarousels'}" data-id-product="{$item.id_product|intval}"><span>{l s='Add to cart' mod='multicarousels'}</span></a>
				{/if}
				
				{if $show_view_more}
					<a itemprop="url" class="white_btn button lnk_view btn btn-default" href="{$item.link|escape:'html':'UTF-8'}" title="{l s='View' mod='multicarousels'}">
						<span>{l s='More' mod='multicarousels'}</span>
					</a>
				{/if}
			</div>
			<div class="product-image-container">
				<a class="product_img_link"	href="{$item.link|escape:'html':'UTF-8'}" title="{$item.name|escape:'html':'UTF-8'}">		
					<img class="replace-2x img-responsive" src="{$link->getImageLink($item.link_rewrite, $item.id_image, {$image_type})|escape:'html':'UTF-8'}" alt="{if !empty($item.legend)}{$item.legend|escape:'html':'UTF-8'}{else}{$item.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($item.legend)}{$item.legend|escape:'html':'UTF-8'}{else}{$item.name|escape:'html':'UTF-8'}{/if}" itemprop="image" />
				</a>
				{if isset($quick_view) && $quick_view}
					<div class="quick-view-wrapper-mobile">
						<a class="quick-view-mobile" href="{$item.link|escape:'html':'UTF-8'}" rel="{$item.link|escape:'html':'UTF-8'}">
							<i class="icon-eye-open"></i>
						</a>
					</div>
					<a class="quick-view" href="{$item.link|escape:'html':'UTF-8'}" rel="{$item.link|escape:'html':'UTF-8'}">
						<span>{l s='Quick view'}</span>
					</a>
				{/if}
				{if $show_stickers && isset($item.new)}
					<span class="new-box">
						<span class="new-label">{l s='New' mod='multicarousels'}</span>
					</span>
				{/if}
				{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($item.show_price) && $item.show_price) || (isset($item.available_for_order) && $item.available_for_order)))}
						{if isset($item.available_for_order) && $item.available_for_order && !isset($restricted_country_mode)}
							<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
								{if ($item.allow_oosp || $item.quantity > 0)}
									{*<span class="{if $item.quantity <= 0 && !$item.allow_oosp}out-of-stock{else}available-now{/if}">
										<link itemprop="availability" href="http://schema.org/InStock" />{if $item.quantity <= 0}{if $item.allow_oosp}{if isset($item.available_later) && $item.available_later}{$item.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($item.available_now) && $item.available_now}{$item.available_now}{else}{l s='In Stock'}{/if}{/if}
									</span>*}
								{elseif (isset($item.quantity_all_versions) && $item.quantity_all_versions > 0)}
									<span class="tag out">
										<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options'}
									</span>
								{else}
									<span class="tag out">
										<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock'}
									</span>
								{/if}
							</span>
						{/if}
					{/if}
			</div>
		</div>
		<div class="right-block">
			<h5>
				<a class="product-name" href="{$item.link|escape:'html':'UTF-8'}" title="{$item.name|escape:'html':'UTF-8'}">
					{$item.name|truncate:30:'...'|escape:'html':'UTF-8'}
				</a>
			</h5>
			{if $show_price && $item.show_price}
				<div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
					{if isset($item.show_price) && $item.show_price && !isset($restricted_country_mode)}
						<span itemprop="price" class="price product-price">
							{if !$priceDisplay}
									{assign 'product_price' $item.price}
								{else}
									{assign 'product_price' $item.price_tax_exc}
								{/if}								
								
								{if $currency->decimals == 1}
									{if !$item_price|strstr:'.'}
										{$item_price = $item_price|cat:'.00'}									
									{else if substr($item_price, strpos($item_price, '.')+2) == ''}
										{$item_price = $item_price|cat:'0'}
									{/if}
								
									{assign price substr($item_price, 0, strpos($item_price, '.')+1)}
									{assign after_fix substr($item_price, strpos($item_price, '.')+1)}
								
									{$currency->prefix}{$price}<sup>{$after_fix}</sup>{$currency->suffix}
								{else}
									{$currency->prefix}{$item_price}{$currency->suffix}
								{/if}
						</span>
						<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
						{if isset($item.specific_prices) && $item.specific_prices && isset($item.specific_prices.reduction) && $item.specific_prices.reduction > 0}
							{hook h="displayProductPriceBlock" product=$item type="old_price"}
							<span class="old-price product-price">
								{displayWtPrice p=$item.price_without_reduction}
							</span>
							{if $item.specific_prices.reduction_type == 'percentage'}
								<span class="tag price-percent-reduction">-{$item.specific_prices.reduction * 100}%</span>
							{/if}
						{/if}
						{hook h="displayProductPriceBlock" product=$item type="price"}
						{hook h="displayProductPriceBlock" product=$item type="unit_price"}
					{/if}
				</div>
			{/if}
		</div>
	</div>
</div>