{* $Id: products_advanced.tpl 1291 2006-02-03 16:44:20Z seva $ *} {if $products} {capture name="mainbox"} {if !$no_sorting} {include file="products_pages/sorting.tpl"} {/if} {if !$no_pagination} {include file="common_templates/pagination.tpl"} {/if} {if $smarty.capture.js_loaded != "Y"} {capture name="js_loaded"}Y{/capture} {/if}

{include file="buttons/add_selected_to_cart.tpl" but_onclick="javascript:if (fn_check_all_exceptions(true)) document.products_bulk_purchase.submit(); else alert('`$lang.cannot_buy`');" but_style='text'}

{foreach from=$products item=product key=key name="products"} {assign var="id" value=$product.product_id}
{include file="products_pages/product_image.tpl" product=$product image_width=$settings.Appearance.thumbnail_width} {$lang.view_details} ››   
{$product.product}
{if $product.product_code}
{$lang.sku}: {$product.product_code}

{/if} {$product.short_description|truncate:280:"... `$lang.more_link`"}

{if $product.discount && $product.price != 0} {/if}
{if $product.discount && $product.price != 0}
{$lang.old_price}: {include file="common_templates/price.tpl" value=$product.price}
{else} {if $product.list_price > $product.price && $product.price != 0} {math equation="list_price - price" list_price=$product.list_price price=$product.price assign="absolute_discount"}
{$lang.list_price}: {include file="common_templates/price.tpl" value=$product.list_price}
{/if} {/if}
{if $product.price != 0 || $settings.General.zero_price_action == 'permit'} {if $product.discount && $product.price != 0}{$lang.discounted_price} {math equation="price - discount" discount=$product.discount price=$product.price assign="our_price"} {if $our_price>=0} {include file="common_templates/price.tpl" value=$our_price span_id="price_display_`$product.product_id`"} {else} {include file="common_templates/price.tpl" value="0" span_id="price_display_`$product.product_id`"} {/if} {else} {if $product.list_price > $product.price && $product.price != 0}{$lang.our_price}{else }{$lang.price}{/if}: {include file="common_templates/price.tpl" value=$product.price span_id="price_display_`$product.product_id`"} {/if} {elseif $settings.General.zero_price_action == 'ask_price'} {$lang.enter_your_price}: {elseif $settings.General.zero_price_action == 'refuse'} {$lang.contact_us_for_price} {/if}
{if $product.discount && $product.price != 0}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.discount}
{else} {if $product.list_price > $product.price && $product.price != 0}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$absolute_discount}
{/if} {/if}
   
   {if $product.discount_type == "A"} {math equation="0 - (100 - ((price / old_price) * 100))" old_price=$product.price price=$our_price format="%d" assign="disc_value"} {else} {math equation="0 - discount" discount=$product.discount_value assign="disc_value"} {/if} {if $disc_value > -100} {include file="common_templates/modifier.tpl" mod_type="P" mod_value=$disc_value non_zeros='Y'} {else} {include file="common_templates/modifier.tpl" mod_type="P" mod_value=-100 non_zeros='Y'} {/if}  

{if $product.is_edp == 'Y'} [{$lang.text_edp_product}]
{/if} {**} {if $product.product_options} {include file="products_pages/product_options_advanced.tpl" product_id=$product.product_id product_options=$product.product_options key=$key}

{/if} {if $settings.General.inventory_tracking == 'Y' && $product.amount <= 0 && $product.is_edp != 'Y' && $product.tracking == 'B'}

{$lang.text_out_of_stock}

{/if} {if !($settings.General.zero_price_action == 'refuse' && $product.price == 0)} {if !($settings.General.inventory_tracking == 'Y' && $product.amount <= 0 && $product.is_edp != 'Y' && $product.tracking == 'B')} {/if} {if $auth.login != ''} {/if}
{if ($settings.General.exception_style == 'warning') && ($product.product_options) && ($exception.$id)} {include file="buttons/add_to_cart.tpl" but_onclick="javascript: if (fn_check_exceptions(`$product.product_id`)) `$ldelim` fn_check_all_checkboxes('products_bulk_purchase', false, 'products_to_add', false); document.getElementById('products_to_add_`$key`_buy_now').value='Y'; document.products_bulk_purchase.submit(); `$rdelim` else `$ldelim` alert('`$lang.cannot_buy`');`$rdelim`"} {else} {include file="buttons/add_to_cart.tpl" but_onclick="javascript: fn_check_all_checkboxes('products_bulk_purchase', false, 'products_to_add', false); document.getElementById('products_to_add_`$key`_buy_now').value='Y'; document.products_bulk_purchase.submit();"} {/if}     {if ($settings.General.exception_style == 'warning') && ($product.product_options) && ($exception.$id)} {include file="buttons/add_to_wishlist.tpl" but_onclick="javascript: if (fn_check_exceptions(`$product.product_id`)) `$ldelim` document.products_bulk_purchase.`$target_name`.value='wishlist'; fn_check_all_checkboxes('products_bulk_purchase', false, 'products_to_add'); document.getElementById('products_to_add_`$key`_buy_now').value='Y'; document.products_bulk_purchase.submit();`$rdelim` else `$ldelim` alert('`$lang.cannot_buy`');`$rdelim`"} {else} {include file="buttons/add_to_wishlist.tpl" but_onclick="javascript: document.products_bulk_purchase.`$target_name`.value='wishlist'; fn_check_all_checkboxes('products_bulk_purchase', false, 'products_to_add'); document.getElementById('products_to_add_`$key`_buy_now').value='Y'; document.products_bulk_purchase.submit();"} {/if}
{/if}

  
{$lang.top} 
 
{if !$smarty.foreach.products.last}

{/if} {/foreach} {if !$no_pagination} {include file="common_templates/pagination.tpl"} {/if}


{include file="buttons/add_selected_to_cart.tpl" but_onclick="javascript: if (fn_check_all_exceptions(true)) document.products_bulk_purchase.submit(); else alert('`$lang.cannot_buy`');" but_style='text'}

{/capture} {if !$title} {$smarty.capture.mainbox} {else} {include file="common_templates/mainbox.tpl" title=$title content=$smarty.capture.mainbox} {/if} {/if}