<!-- indi:item_box -->

{assign var=att_name_1 value=false}
{assign var=att_unit_1 value=false}
{assign var=att_name_2 value=false}
{assign var=att_unit_2 value=false}
{assign var=no_details value="0"}

{if $shopArticle->schema_data->selectable_attribute_1 || $shopArticle->schema_data->selectable_attribute_2}
	{foreach from=$shopArticle->schema_data_attributes item=attribute}
		{if $shopArticle->schema_data->selectable_attribute_1 == $attribute.number}
			{assign var=att_name_1 value="`$attribute.name`"}
			{assign var=att_unit_1 value="`$attribute.unit`"}
		{/if}
		{if $shopArticle->schema_data->selectable_attribute_2 == $attribute.number}
			{assign var=att_name_2 value="`$attribute.name`"}
			{assign var=att_unit_2 value="`$attribute.unit`"}
		{/if}
	{/foreach}
{/if}

{if !$user_lang || $user_lang == $system_configuration.default_system_language || !$shopArticle->short_description_en}
	{$shortruncated = $shopArticle->short_description|truncate:500:"...":false|strip_tags}
{else}
	{$shortruncated = $shopArticle->short_description_en|truncate:500:"...":false|strip_tags}
{/if}

<div class="list_item_box">
	<a title="Zeige alle Bilder" class="imagebox" rel="{$shopArticle->id}" href="#" style="background-image:url({$SHOP_DIR}/images/article/overview_{if $shopArticle->default_image_file_name}{$shopArticle->default_image_file_name}{else}default_image.png{/if});">
		{if $shopArticle->default_image_file_name}
			<span>Zeige alle Bilder</span>
		{/if}
	</a>
	{if $show_memory_items == 1}
		<a class="button_details button_delete_memory_item"  href="?item_id={$shopArticle->id}&action=delete">von Merkliste entfernen</a>
	{/if}
	<div class="primary_data_box">
		<div id="artheader">
			<div class="artname">
				{if $no_details == 1}
					{if !$user_lang || $user_lang == $system_configuration.default_system_language || !$shopArticle->name_en}
						<h2><a href="" class="article_details" title="Details" >{$shopArticle->name}</a></h2>
					{else}
						<h2><a href="{$itemSuri}" class="button_details" title="Details" >{$shopArticle->name_en}</a></h2>
					{/if}
				{else}
					{if !$user_lang || $user_lang == $system_configuration.default_system_language || !$shopArticle->name_en}
						<h2><a href="{$itemSuri}" class="article_details" title="Details" >{$shopArticle->name}</a></h2>
					{else}
						<h2><a href="{$itemSuri}" class="article_details" title="Details" >{$shopArticle->name_en}</a></h2>
					{/if}
				{/if}

				{if $shopArticle->number || $shopArticle->manufacturer_item_number}
					<h3 class="product_no">
						{if $shopArticle->number}
							{if $shopArticle->attribute_7 && $shopArticle->number != $shopArticle->attribute_7}
								<strong>Art.-Nr.: {$shopArticle->attribute_7}
									&nbsp;&nbsp;&nbsp;<span style="font-weight:normal;">({$template_text.item_details.old_item_number_title} {$shopArticle->number})</span>
							{else}
								<strong>Art.-Nr.: {$shopArticle->number}
							{/if}
								</strong>
						{/if}
						{if $shopArticle->manufacturer_item_number}
							Hersteller-Nr.: {$shopArticle->manufacturer_item_number}
						{/if}
					</h3>
				{/if}
			</div>
			<div class="artmanulogo">
				{if $shopArticle->manufacturer_data->logo}
					<img class="manufacturer_logo" src="{$SHOP_DIR}images/manufacturers/{$shopArticle->manufacturer_data->logo}">
				{/if}
			</div>
		</div>
		<div class="availability">
			{if $shopArticle->inventory > 0}

			{else}
				{if $shopArticle->shippable == 0}
					{if $shortruncated|stristr:"Ersatz siehe Alternativartikel" || $shortruncated|stristr:"Ersatz siehe Details / Alternativartikel"}
						{assign var=no_details value="1"}
						<span class="notAvailable" style="font-size:12px;font-weight:bold;color:#ff0000;">Ersatz siehe <a style="font-size:12px;font-weight:bold;" href="{$itemSuri}#realfriends">Alternativ Artikel</a>, <span style="color:#000000;font-weight:normal;">da dieser nicht mehr lieferbar ist.</span></span><br><br>
						<a href="{$itemSuri}#realfriends" class="button_details" title="Details" style="position:relative;top:0px;left:0px;width:250px;">Weiter zum Alternativ Artikel</a>
					{else}
						<span class="notAvailable">Nicht lieferbar</span>
					{/if}
				{/if}
			{/if}
		</div>
		{if $no_details == 0}
			<div class="description">{$shortruncated}</div>
		{/if}
	</div>

	<div class="variants_box">
		{assign var=new_price value=""}
		{if $shopArticle->schema_data->selectable_attribute_1 || $shopArticle->schema_data->selectable_attribute_2}
			{foreach from=$shopArticle->schema_data_attributes item=attribute}
				{if $shopArticle->schema_data->selectable_attribute_1 == $attribute.number}
					{assign var=att_name_1 value="`$attribute.name`"}
					{assign var=att_unit_1 value="`$attribute.unit`"}
				{/if}
			{/foreach}

			{foreach from=$shopArticle->schema_data_attributes item=attribute}
				{if $shopArticle->schema_data->selectable_attribute_2 == $attribute.number}
					{assign var=att_name_2 value="`$attribute.name`"}
					{assign var=att_unit_2 value="`$attribute.unit`"}
				{/if}
			{/foreach}

			<div class="item_variant_box">
				<div class="box_title">
					<span class="button_name" style="top:5px;">Bitte w&auml;hlen Sie eine passende Variante</span>
				</div>
				<div class="widget_menu_arrow"></div>
			</div>
			<div class="variant_selection_box">
				{foreach item=item name=cartLoop from=$shopArticle->variant_structure}
					{if !$new_price || $new_price > $item.shop_price_1}
						{assign var=new_price value=$item.shop_price_1}
					{/if}
					{if $shopArticle->id == $item.id}
						{assign var=preis_praefix value=""}
					{/if}


					{if $item.short_uri}
						{assign var=useUri value="`$item.short_uri`.html"}
					{else}
						{assign var=useUri value="/index.php?item_id=`$item.id`"}
					{/if}

					<a href="{$useUri}" title="{$item.name}">
						<div class="variant_item">
							<span class="item_name">{$item.name}</span>
							<span class="item_number">{$item.number}</span>

							<span class="item_vdata">
								{if $shopArticle->schema_data->selectable_attribute_1}
									{$att_name_1}: {$item.data->attribute_1} {$att_unit_1}<br>
								{/if}
								{if $shopArticle->schema_data->selectable_attribute_2}
									{$att_name_2}: {$item.data->attribute_2} {$att_unit_2}<br>
								{/if}
							</span>

							<div class="variant_item_image" style="background:#ffffff url({$SHOP_DIR}/images/article/thumb_{if $item.default_image_file_name}{$item.default_image_file_name}{else}default_image.png{/if}) center center no-repeat;"></div>

							<span class="item_price">
								{if $item.price_type != 0}
									{if $item.sample_price}
										{$item.sample_price|number_format:"2":",":"."} &euro; / {$shopArticle->sample_unit}
									{else}
										{$item.shop_price_1|number_format:"2":",":"."} &euro;
									{/if}
								{/if}
							</span>
						</div>
					</a>
				{/foreach}
			</div>
		{/if}
	</div>

	<div class="link_box">
		<strong>Artikelinformationen:</strong>

		{if $shopArticle->has_documents}
			<a href="{$itemSuri}#documents" title="Files">{$template_text.item_details.data_sheet}</a>
		{/if}
		{if $shopArticle->has_additional_items}
			<a href="{$itemSuri}#additionalitems" title="Passendes Zubeh&auml;r">{$template_text.item_details.menutitle_additional_parts}</a>
		{/if}
		{if $shopArticle->has_spare_parts}
			<a href="{$itemSuri}#spareparts" tilte="Ersatzteile">{$template_text.item_details.menutitle_spare_parts}</a>
		{/if}
		{if $shopArticle->has_real_friends}
			<a href="{$itemSuri}#realfriends" tilte="Alternativartikel">{$template_text.item_details.real_friends_title}</a>
		{/if}

		<a href="{$itemSuri}#suitableFor" title="Hersteller">F&uuml;r folgende Hersteller</a>
	</div>

	{*{if $no_details == 1}
		<a href="{$itemSuri}" class="button_details" title="Details" style="background-image:none;background:#dddddd;">Details</a>
	{else}
		<a href="{$itemSuri}" class="button_details" title="Details">Details</a>
	{/if}*}

	<div id="artinfobox">
		<div class="linkbox">
		{if $no_details == 1}
			<a href="{$itemSuri}" class="button_details_no" title="Details" style="background-image:none;background:#dddddd;">Zum Artikel</a>
			{else}
			<a href="{$itemSuri}" class="button_details" title="Details">Zum Artikel</a>
			{/if}
		</div>
		<div class="pricing_box">
			{if !$no_prices && $shopArticle->price_type == "1"}
				<div class="price">
					{if $shopArticle->shop_bargain_price_1 > 0 && $shopArticle->shop_bargain_price_1 < $shopArticle->shop_price_1}
						<span class="oldprice">
							{* statt {$shopArticle->shop_price_1|number_format:2:',':" "}&nbsp;&euro; *}
						</span>
						{$shopArticle->attribute_10} {$shopArticle->price_praefix} {$shopArticle->shop_bargain_price_1|number_format:2:',':" "}&nbsp;&euro;
					{else}
						{$shopArticle->attribute_10} {$shopArticle->price_praefix} {$shopArticle->shop_price_1|number_format:2:',':" "}&nbsp;&euro;
					{/if}
				</div>
				<span class="taxInfo">
					{if $shopArticle->sample_price && $shopArticle->sample_unit && $shopArticle->sample_price > 0 || $item_debug}
						Preis / {$shopArticle->sample_unit} = {$shopArticle->sample_price|number_format:"2":",":"."} &euro;<br>
					{/if}
					{$shopArticle->price_tax_text}
				</span>
			{else if $shopArticle->price_type == "0"}
				<span class="price_on_request">Preis auf Anfrage</span><br>
			{/if}


			<div class="availability">
				{if $shopArticle->inventory > 0}
					{if $shopArticle->shippable_inventory == 0}
						<span class="notAvailable">Nicht lieferbar</span>
					{elseif $shopArticle->shippable_inventory == 1}
						{*Artikel lieferbar*}{if $shopArticle->attribute_14 == ''}{$template_text.item_details.item_state_available}{else}{$shopArticle->attribute_14}{/if}
					{elseif $shopArticle->shippable_inventory == 3}
						Lieferzeit unbekannt
					{elseif $shopArticle->shippable_inventory == 4}
						Bestellartikel (Lieferzeit 2-3 Tage)
					{elseif $shopArticle->shippable_inventory == 5}
						Bestellartikel (Lieferzeit 14 Tage)
					{/if}
				{else}
					{if $shopArticle->shippable == 0}

					{elseif $shopArticle->shippable == 1}
						{*Artikel lieferbar*}{if $shopArticle->attribute_14 == ''}{$template_text.item_details.item_state_available}{else}{$shopArticle->attribute_14}{/if}
					{elseif $shopArticle->shippable == 2 && $shopArticle->available_from && $shopArticle->available_till != '0000-00-00'}
						<span class="availableInRange">Lieferbar vom {$shopArticle->available_from|date_format:"%d.%m.%Y"} bis {$shopArticle->available_till|date_format:"%d.%m.%Y"}</span>
					{elseif $shopArticle->shippable == 2 && $shopArticle->available_from}
						<span class="availableInRange">Lieferbar ab {$shopArticle->available_from|date_format:"%d.%m.%Y"}</span>
					{elseif $shopArticle->shippable == 3}
						<span class="availableInRange">Lieferzeit unbekannt</span>
					{elseif $shopArticle->shippable == 4}
						Bestellartikel (Lieferzeit 2-3 Tage)
					{elseif $shopArticle->shippable == 5}
						Bestellartikel (Lieferzeit 14 Tage)
					{/if}
				{/if}
			</div>

		</div>
	</div>
</div>