{{function name="displayPriceInfo" aProduct=null}}
<div class="prices">
	{{if $config.iNettoOption > 0}}
		<div class="price netto">
			{{if $aProduct.iVisiblePrice}}
				{{if isset($aProduct.sDiscountPercent)}}
					<div class="old"><span class="value">{{number_format( $aProduct.fCatalogPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					<span class="value">{{number_format( $aProduct.fPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span>
				{{else}}
					{{if !empty( $aProduct.fPriceOld )}}
						<div class="old"><span class="value">{{number_format( $aProduct.fPriceOld / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					{{/if}}
					<span class="value">{{number_format( $aProduct.fPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span>
					{{if $aProduct.fCatalogPrice > $aProduct.fPrice}}
						<div class="catalog">{{$lang.Catalog_price}}: <span class="value">{{number_format( $aProduct.fCatalogPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					{{/if}}
				{{/if}}
			{{/if}}
		</div>
	{{/if}}
	{{if $config.iNettoOption < 2}}
		<div class="price gross">
			{{if $aProduct.iVisiblePrice}}
				{{if $config.iNettoOption == 1}}
					<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Inc_vat}}</span>
				{{else}}
					{{if isset($aProduct.sDiscountPercent)}}
						<div class="old"><span class="value">{{$aProduct.sCatalogPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span>
					{{else}}
						{{if !empty( $aProduct.sPriceOld )}}
							<div class="old"><span class="value">{{$aProduct.sPriceOld}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						{{/if}}
						<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span>
						{{if $aProduct.fCatalogPrice > $aProduct.fPrice}}
							<div class="catalog">{{$lang.Catalog_price}}: <span class="value">{{$aProduct.sCatalogPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						{{/if}}
					{{/if}}
				{{/if}}
			{{/if}}
		</div>
	{{/if}}
</div>
{{/function}}

{{function name="basketLink" aProduct=null sBasketPage=null}}
	{{if $aProduct.iVisiblePrice}}
		{{if isset( $sBasketPage ) && ( $aProduct.iNotForSale == 0 ) && ( $aProduct.iCanBuy > 0 )}}
			{{if $aProduct.iVariantCount == 1}}
				{{if $aBlock.sProductsShow != 'LIGHTBOXES' && $config.List_quantity_input}}<input class="input product_quantity" type="text" name="iQuantity" value="1" />{{/if}}
				<a class="basket direct" href="{{$sBasketPage}}iProductAdd={{$aProduct.iProduct}}&amp;iQuantity=1" rel="nofollow" title="{{$lang.basket_add}} - {{$aProduct.sName}}">{{$lang.basket_add}}</a>
			{{else}}
				<a class="basket" href="{{$aProduct.sLinkName}}" rel="nofollow" title="{{$lang.basket_add}} - {{$aProduct.sName}}">{{$lang.basket_add}}</a>
			{{/if}}
		{{/if}}
	
	{{/if}}
{{/function}}


{{if empty( $aBlock.aProducts.aList )}}
	<p>{{$lang.empty_category}}</p>
{{else}}
	{{if $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras}}
		<div class="products-head">
			<form action="{{$aPage.sLinkName}}{{$sUrlExt}}" method="post" class="products-per-page">
				<fieldset>
					<label>{{$lang.Items_on_page}}:
						<select class="select products-per-page" name="count_{{$aBlock.iElement}}" size="1">
							<option {{if $aBlock.aProducts.iList == 6  }}selected="selected"{{/if}} value="6  ">6  </option>
							<option {{if $aBlock.aProducts.iList == 12 }}selected="selected"{{/if}} value="12 ">12 </option>
							<option {{if $aBlock.aProducts.iList == 18 }}selected="selected"{{/if}} value="18 ">18 </option>
							<option {{if $aBlock.aProducts.iList == 30 }}selected="selected"{{/if}} value="30 ">30 </option>
							<option {{if $aBlock.aProducts.iList == 60 }}selected="selected"{{/if}} value="60 ">60 </option>
							<option {{if $aBlock.aProducts.iList == 120}}selected="selected"{{/if}} value="120">120</option>
						</select>
					</label>
				</fieldset>
			</form>
			<form class="products-sort" action="{{$aPage.sLinkName}}{{$sUrlExt}}" method="post">
				<fieldset>
					<label>{{$lang.sort_order}}:
						<select class="select products-sort" name="sort_{{$aBlock.iElement}}">
							<option value="default"    {{if $aBlock.aProducts.sort_order == 'default'   }}selected="selected"{{/if}}>{{$lang.sort_default}}</option>
							<option value="name_inc"   {{if $aBlock.aProducts.sort_order == 'name_inc'  }}selected="selected"{{/if}}>{{$lang.sort_name}} {{$lang.sort_inc}}  </option>
							<option value="name_desc"  {{if $aBlock.aProducts.sort_order == 'name_desc' }}selected="selected"{{/if}}>{{$lang.sort_name}} {{$lang.sort_desc}} </option>
							{{if !$config.prices_off}}
								<option value="price_inc"  {{if $aBlock.aProducts.sort_order == 'price_inc' }}selected="selected"{{/if}}>{{$lang.sort_price}} {{$lang.sort_inc}} </option>
								<option value="price_desc" {{if $aBlock.aProducts.sort_order == 'price_desc'}}selected="selected"{{/if}}>{{$lang.sort_price}} {{$lang.sort_desc}}</option>
							{{/if}}
							<option value="date_inc"   {{if $aBlock.aProducts.sort_order == 'date_inc'  }}selected="selected"{{/if}}>{{$lang.sort_date}} {{$lang.sort_inc}}  </option>
							<option value="date_desc"  {{if $aBlock.aProducts.sort_order == 'date_desc' }}selected="selected"{{/if}}>{{$lang.sort_date}} {{$lang.sort_desc}} </option>
							{{foreach from=$aPromotedUsed item=iPromoted}}
								<option value="promoted{{$iPromoted}}" {{if $aBlock.aProducts.sort_order == 'promoted'|cat:$iPromoted }}selected="selected"{{/if}}>{{$lang.sort_first}} {{$config['promoted'|cat:$iPromoted|cat:'_name']}}</option>
							{{/foreach}}
						</select>
					</label>
				</fieldset>
			</form>
			{{if $config.compare_products}}
				<div class="compare-wrapper">
					<div class="compare-show">
						<a href="index.php?p=products-compare" title="{{$lang.compare_products}}" rel="nofollow">{{$lang.compare_products}}</a>
					</div>
				</div>
			{{/if}}
		</div>
	{{/if}}

	{{if $aBlock.sProductsShow == 'TABLE'}}
		<table class="products {{$aBlock.sProductsShow}} {{if $aBlock.sType != 'PRODUCTS' || $aBlock.bExtras || !$config.compare_products}}nocompare{{/if}}">
			<thead>
				<tr><th class="name">{{$lang.Name}}</th><th class="index">{{$lang.Product_index}}</th><th class="producer">{{$lang.Producer}}</th>{{if !$config.prices_off}}<th class="price">{{$lang.Price}}</th><th class="basket"></th>{{/if}}</tr>
			</thead>
			<tbody>
				{{foreach from=$aBlock.aProducts.aList item=aProduct}}
					<tr id="product_{{$aBlock.iElement}}_{{$aProduct.iProduct}}" {{if $aProduct.iStatus == 0}}class="admin"{{/if}}>
						<td class="name">{{if $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras && $config.compare_products}}<span class="compare compare-add"><input type="checkbox" id="compareCb-{{$aProduct.iProduct}}" {{if $aProduct.bInCompare}}checked="checked"{{/if}} title="{{$lang.toCompare}}"/></span>{{/if}} <a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">{{$aProduct.sName}}</a></td>
						<td class="index">{{$aProduct.sProductIndex}}</td>
						<td class="producer">{{$aProduct.aProducer.sName}}</td>
						{{if !$config.prices_off}}
							<td class="price">{{displayPriceInfo aProduct=$aProduct}}</td>
							<td class="basket">
								{{basketLink aProduct=$aProduct sBasketPage=$aBlock.aProducts.sBasketPage}}
								{{if isset( $aProduct.bInStorage )}}
									{{if $aProduct.bInStorage}}
										<a class="storage remove" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageRemove={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_rem}} - {{$aProduct.sName}}">{{$lang.storage_rem}}</a>
									{{else}}
										<a class="storage add" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageAdd={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_add}} - {{$aProduct.sName}}">{{$lang.storage_add}}</a>
									{{/if}}
								{{/if}}
							</td>
						
						{{/if}}
					</tr>
				{{/foreach}}
			</tbody>
		</table>
	{{elseif $aBlock.sProductsShow == 'LIGHTBOXES'}}
		<ul class="products {{$aBlock.sProductsShow}} {{if $aBlock.sType != 'PRODUCTS' || $aBlock.bExtras || !$config.compare_products}}nocompare{{/if}}">
			{{foreach from=$aBlock.aProducts.aList item=aProduct}}
				<li id="product_{{$aBlock.iElement}}_{{$aProduct.iProduct}}" {{if $aProduct.iStatus == 0}}class="admin"{{/if}}>
					<div class="hover">
						<h3>
							<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">{{$aProduct.sName}}</a>
						</h3>
						{{if !$config.prices_off}}
							{{basketLink aProduct=$aProduct sBasketPage=$aBlock.aProducts.sBasketPage}}
						{{/if}}
						{{if isset( $aProduct.bInStorage )}}
							{{if $aProduct.bInStorage}}
								<a class="storage remove" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageRemove={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_rem}} - {{$aProduct.sName}}">{{$lang.storage_rem}}</a>
							{{else}}
								<a class="storage add" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageAdd={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_add}} - {{$aProduct.sName}}">{{$lang.storage_add}}</a>
							{{/if}}
						{{/if}}
						{{if $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras && $config.compare_products}}
							<span class="compare compare-add"><label><input type="checkbox" id="compareCb-{{$aProduct.iProduct}}" {{if $aProduct.bInCompare}}checked="checked"{{/if}} title="{{$lang.toCompare}}"/> {{$lang.toCompare}}</label></span>
						{{/if}}
					</div>
					<div class="photo">
						<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">
							{{if !empty( $aProduct.aDataImage )}}
								<img alt="{{$aProduct.sName}} - {{if !empty( $aProduct.aDataImage.sDescription )}}{{$aProduct.aDataImage.sDescription}} - {{/if}}{{$aProduct.aDataImage.sFileName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/{{$aProduct.aDataImage.sFileName}}" />
							{{else}}
								<img alt="{{$aProduct.sName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/nophoto.png" />
							{{/if}}
						</a>
						{{if isset($aProduct.sDiscountPercent)}}
							<div class="promo discount">{{$lang.Promotion}} -{{$aProduct.sDiscountPercent}}%</div>
						{{elseif !empty( $aProduct.aPromoted )}}
							{{$iPromotionMain = min( array_keys( $aProduct.aPromoted ) )}}
							<div class="promo" style='background-color: {{$config["promoted{{$iPromotionMain}}_color_prom"]}}'>{{$config["promoted{{$iPromotionMain}}_name_prom"]}}</div><br />
						{{/if}}
					</div>
					{{if !$config.prices_off}}
						{{displayPriceInfo aProduct=$aProduct}}
					{{/if}}
				</li>
			{{/foreach}}
		</ul>
	{{elseif $aBlock.sProductsShow == 'LIGHTLIST' || $aBlock.sProductsShow == 'LIGHTLIST_PHOTO'}}
		<ul class="products {{$aBlock.sProductsShow}} {{if $aBlock.sType != 'PRODUCTS' || $aBlock.bExtras || !$config.compare_products}}nocompare{{/if}}">
			{{foreach from=$aBlock.aProducts.aList item=aProduct}}
				<li id="product_{{$aBlock.iElement}}_{{$aProduct.iProduct}}" class="{{if $aProduct.iStatus == 0}}admin{{/if}} {{if $aProduct@first}}first_element{{/if}}">
					{{if $aBlock.sProductsShow == 'LIGHTLIST_PHOTO'}}
						<div class="photo">
							<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">
								{{if !empty( $aProduct.aDataImage )}}
									<img alt="{{$aProduct.sName}} - {{if !empty( $aProduct.aDataImage.sDescription )}}{{$aProduct.aDataImage.sDescription}} - {{/if}}{{$aProduct.aDataImage.sFileName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/{{$aProduct.aDataImage.sFileName}}" />
								{{else}}
									<img alt="{{$aProduct.sName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/nophoto.png" />
								{{/if}}
							</a>
							{{if isset($aProduct.sDiscountPercent)}}
								<div class="promo discount">{{$lang.Promotion}} -{{$aProduct.sDiscountPercent}}%</div>
							{{elseif !empty( $aProduct.aPromoted )}}
								{{$iPromotionMain = min( array_keys( $aProduct.aPromoted ) )}}
								<div class="promo" style='background-color: {{$config["promoted{{$iPromotionMain}}_color_prom"]}}'>{{$config["promoted{{$iPromotionMain}}_name_prom"]}}</div><br />
							{{/if}}
						</div>
					{{/if}}
					<h3>
						{{if $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras && $config.compare_products}}
							<span class="compare compare-add"><input type="checkbox" id="compareCb-{{$aProduct.iProduct}}" {{if $aProduct.bInCompare}}checked="checked"{{/if}} title="{{$lang.toCompare}}"/></span>
						{{/if}}
						<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">{{$aProduct.sName}} {{displayPriceInfo aProduct=$aProduct}}</a>
					</h3>
				</li>
			{{/foreach}}
		</ul>
	{{else}}
		<ul class="products {{$aBlock.sProductsShow}} {{if $aBlock.sType != 'PRODUCTS' || $aBlock.bExtras || !$config.compare_products}}nocompare{{/if}}">
			{{foreach from=$aBlock.aProducts.aList item=aProduct}}
				<li id="product_{{$aBlock.iElement}}_{{$aProduct.iProduct}}" {{if $aProduct.iStatus == 0}}class="admin"{{/if}}>
					<h3>
						{{if $smarty.session.bSellSmartUser && !empty( $aProduct.sAdminInfo )}}
							<img src="templates/admin/images/ico/comment-new.png" title="{{$aProduct.sAdminInfo}}" class="tTip info" style="position: absolute; top: 60px; right: 0px;" />
						{{/if}}

						{{if $aBlock.sProductsShow == 'LIST' && $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras && $config.compare_products}}
							<span class="compare compare-add"><input type="checkbox" id="compareCb-{{$aProduct.iProduct}}" {{if $aProduct.bInCompare}}checked="checked"{{/if}} title="{{$lang.toCompare}}"/></span>
						{{/if}}
						<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">{{$aProduct.sName}}</a>
						{{if $aBlock.sProductsShow == 'LIST'}}
							{{if !empty( $aProduct.aProducer.sLogoUrl )}}
								<img class="producer" alt="{{$aProduct.aProducer.sName}} - {{$aProduct.aProducer.sLogoUrl}}" src="{{$config.dir_files}}h30/{{$aProduct.aProducer.sLogoUrl}}" />
							{{else}}
								<span class="producer">{{$aProduct.aProducer.sName}}</span>
							{{/if}}
						{{/if}}
					</h3>
					<div class="photo">
						<a href="{{$aProduct.sLinkName}}" title="{{$aProduct.sName}}">
							{{if !empty( $aProduct.aDataImage )}}
								<img alt="{{$aProduct.sName}} - {{if !empty( $aProduct.aDataImage.sDescription )}}{{$aProduct.aDataImage.sDescription}} - {{/if}}{{$aProduct.aDataImage.sFileName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/{{$aProduct.aDataImage.sFileName}}" />
							{{else}}
								<img alt="{{$aProduct.sName}}" src="{{$config.dir_files}}{{$aProductMinSizes[$aBlock.sProductsShow]}}/nophoto.png" />
							{{/if}}
						</a>
						{{if isset($aProduct.sDiscountPercent)}}
							<div class="promo discount">{{$lang.Promotion}} -{{$aProduct.sDiscountPercent}}%</div>
						{{elseif !empty( $aProduct.aPromoted )}}
							{{$iPromotionMain = min( array_keys( $aProduct.aPromoted ) )}}
							<div class="promo" style='background-color: {{$config["promoted{{$iPromotionMain}}_color_prom"]}}'>{{$config["promoted{{$iPromotionMain}}_name_prom"]}}</div><br />
						{{/if}}
					</div>
					{{if $aBlock.sProductsShow == 'LIST'}}
						<div class="desc">
							{{$aProduct.sDescriptionShort}}
						</div>
					{{/if}}
					<div class="basket-container clear {{if !$aProduct.iVisiblePrice || !isset( $aBlock.aProducts.sBasketPage ) || ( $aProduct.iNotForSale == 1 ) || ( $aProduct.iCanBuy == 0 )}}nobutton{{/if}}">
						{{if !$config.prices_off}}
							{{displayPriceInfo aProduct=$aProduct}}
							{{basketLink aProduct=$aProduct sBasketPage=$aBlock.aProducts.sBasketPage}}
						{{else}}
							<p class="available">{{$lang.Ask_about_product}}<br /><a href=mailto:{{$config.orders_email}}>{{$config.orders_email}}</a></p>
						{{/if}}
						{{if $aBlock.sProductsShow == 'BOXES' && $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras && $config.compare_products}}
							<br/>
							<span class="compare compare-add"><label><input type="checkbox" id="compareCb-{{$aProduct.iProduct}}" {{if $aProduct.bInCompare}}checked="checked"{{/if}} title="{{$lang.toCompare}}"/> {{$lang.toCompare}}</label></span>
						{{/if}}
						{{if isset( $aProduct.bInStorage )}}
							{{if $aProduct.bInStorage}}
								<a class="storage remove" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageRemove={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_rem}} - {{$aProduct.sName}}">{{$lang.storage_rem}}</a>
							{{else}}
								<a class="storage add" href="{{$aPage.sLinkName}}{{$sUrlExt}}{{if empty( $sUrlExt )}}?{{else}}&amp;{{/if}}iProductStorageAdd={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_add}} - {{$aProduct.sName}}">{{$lang.storage_add}}</a>
							{{/if}}
						{{/if}}
					</div>
				</li>
			{{/foreach}}
		</ul>
	{{/if}}
	{{if $aBlock.sType == 'PRODUCTS' && !$aBlock.bExtras}}
		<div class="pages clear">
			{{$sUrl = str_replace( '.html', '', $aBlock.aProducts.sLinkNamePages )}}
			{{if substr_count( $sUrl, ',' ) < 1}}{{$sUrl = $sUrl|cat:','}}{{/if}}
			{{countPages iPages=$aBlock.aProducts.aPagesCountData.iCount iPageNumber=$aBlock.aProducts.aPagesCountData.iPageNumber sUrl=$sUrl|cat:","|cat:$aBlock.iElement sUrl2=$sUrlExt}}
		</div>
	{{elseif !empty( $aBlock.aMorePage )}}
		<div class="more clear">
			<a class="more" href="{{$aBlock.aMorePage.sLinkName}}" title="{{$aBlock.aMorePage.sName}}">{{if empty( $aBlock.aMorePage.sMoreLink )}}{{$lang.more}} &raquo;{{else}}{{$aBlock.aMorePage.sMoreLink}}{{/if}}</a>
		</div>
	{{/if}}
{{/if}}
