{* $Id: products_advanced.tpl 1755 2006-05-12 11:20:11Z zeke $ *} {if $products} {capture name="mainbox"} {if $smarty.capture.js_loaded != "Y"} {capture name="js_loaded"}Y{/capture} {/if}
{if !$no_pagination} {include file="common_templates/pagination.tpl"} {/if} {if !$no_sorting} {include file="products_pages/sorting.tpl"} {/if}

{include file="buttons/add_selected_to_cart.tpl" but_onclick="javascript: add_bulk_products();" 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 obj_id=$id} {$lang.view_details} ››   
{$product.product}
{if $product.product_code}
{$lang.sku}: {$product.product_code}

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

{************************************ Discount label ****************************} {if $product.discount && $product.price != 0} {/if} {* / Discount label *}
{******************************* List price, Old Price **************************} {if $product.discount && $product.price != 0}
{$lang.old_price}: {include file="common_templates/price.tpl" value=$product.price span_id="original_price_`$product.product_id`" class="list-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} {************************ Discounted Price, Our Price, Price ********************}
{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="discounted_price_`$product.product_id`"} {else} {include file="common_templates/price.tpl" value="0" span_id="discounted_price_`$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="original_price_`$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}
{************************************* You Save: *******************************} {if $product.discount && $product.price != 0}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.discount span_id="save_`$product.product_id`" class="discount"}
{else} {if $product.list_price > $product.price && $product.price != 0}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$absolute_discount span_id="save_`$product.product_id`" class="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' spanm_id="discount_label_`$product.product_id`" class="discount-label-text"} {else} {include file="common_templates/modifier.tpl" mod_type="P" mod_value=-100 non_zeros='Y' spanm_id="discount_label_`$product.product_id`" class="discount-label-text"} {/if}  

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

{/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.user_id && $settings.Modules.wishlist == 'Y' && $hide_wishlist_button != 'Y'} {/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_single_purchase('`$product.product_id`','cart'); `$rdelim` else `$ldelim` alert(cannot_buy);`$rdelim`"} {else} {include file="buttons/add_to_cart.tpl" but_onclick="javascript: fn_single_purchase('`$product.product_id`', 'cart');"} {/if}        {if ($settings.General.exception_style == 'warning') && ($exception.$id) && ($product.product_options)} {include file="buttons/add_to_wishlist.tpl" but_onclick="javascript: if (fn_check_exceptions(`$product.product_id`)) `$ldelim` fn_single_purchase('`$product.product_id`', 'wishlist');`$rdelim` else `$ldelim` alert(cannot_buy);`$rdelim`"} {else} {include file="buttons/add_to_wishlist.tpl" but_onclick="javascript: fn_single_purchase('`$product.product_id`', 'wishlist');"} {/if}
{/if}

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


{include file="buttons/add_selected_to_cart.tpl" but_onclick="javascript: add_bulk_products();" but_style='text'}

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