Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 23.17 KB | None | 0 0
  1. {**
  2.  *  Keresés minden találatnál a termékek betöltése
  3.  *
  4.  *  !!!VIGYÁZAT!!! Itt fekete mágia történik, mivel egy tömböt adok át neki, de alapvetően
  5.  *  Product objektummal dolgozik, csak a smarty-nak hála ugyanúgy tudja kezelni.
  6.  *  Ettől függetlenül még lehetnek benne hiányosságok.
  7.  *}
  8.  
  9. {if isset($products) && $products}
  10.     {assign var='nbItemsPerLine' value=3}
  11.     {assign var='nbItemsPerLineTablet' value=2}
  12.     {assign var='nbItemsPerLineMobile' value=2}
  13.  
  14.     {*define numbers of product per line in other page for tablet*}
  15.     {assign var='nbLi' value=$products|@count}
  16.     {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
  17.     {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet}
  18.     <h1 class="page-heading product-listing">
  19.         <span class="cat-name">
  20.             {l s='Products' mod='lincossearchmodule'}
  21.         </span>
  22.         <span class="heading-counter" style="visibility: hidden">
  23.             <span class="counter-number">
  24.             </span>
  25.             {if ($products|count) > 1}
  26.                 {l s='products found' mod='lincossearchmodule'}
  27.             {else}
  28.                 {l s='product found' mod='lincossearchmodule'}
  29.             {/if}
  30.  
  31.         </span>
  32.     </h1>
  33.     <div class="content_sortPagiBar">
  34.         <div class="sortPagiBar clearfix {if isset($instant_search) && $instant_search} instant_search{/if}">
  35.     <ul class="display hidden-xs">
  36.         <li class="display-title">{l s='View:' mod='lincossearchmodule'}</li>
  37.         <li id="grid"><a rel="nofollow" href="#" title="{l s='Grid' mod='lincossearchmodule'}"><i class="icon-th-large"></i>{l s='Grid' mod='lincossearchmodule'}</a></li>
  38.         <li id="list"><a rel="nofollow" href="#" title="{l s='List' mod='lincossearchmodule'}"><i class="icon-th-list"></i>{l s='List' mod='lincossearchmodule'}</a></li>
  39.     </ul>
  40. </div>
  41. </div>
  42.     <!-- Products list -->
  43.     <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}">
  44.     {foreach from=$products item=product name=products}
  45.         {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo}
  46.         {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet}
  47.         {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile}
  48.         {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if}
  49.         {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if}
  50.         {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if}
  51.         <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">
  52.             <div class="product-container" itemscope itemtype="https://schema.org/Product">
  53.                 <div class="left-block">
  54.                     <div class="product-image-container">
  55.  
  56.                         <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
  57.                             <img class="replace-2x img-responsive" src="//{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />
  58.                         </a>
  59.  
  60.                         <div class="product-flags">
  61.                             {hook h='displayProductListImage' product=$product}
  62.                             {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  63.                                 {if isset($product.online_only) && $product.online_only}
  64.                                     <span class="online_only">{l s='Online only' mod='lincossearchmodule'}</span>
  65.                                 {/if}
  66.                             {/if}
  67.                             {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  68.                                 {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  69.                                     <span class="discount">{l s='discount' mod='lincossearchmodule'}</span>
  70.                                 {/if}
  71.                         </div>
  72.                         {if isset($quick_view) && $quick_view}
  73.                             <div class="quick-view-wrapper-mobile">
  74.                             <a class="quick-view-mobile" href="{$product.link|escape:'html':'UTF-8'}" rel="{$product.link|escape:'html':'UTF-8'}">
  75.                                 <i class="icon-eye-open"></i>
  76.                             </a>
  77.                         </div>
  78.                         <a class="quick-view" href="{$product.link|escape:'html':'UTF-8'}" rel="{$product.link|escape:'html':'UTF-8'}">
  79.                             <span>{l s='Quick view' mod='lincossearchmodule'}</span>
  80.                         </a>
  81.                         {/if}
  82.                         {if (!$PS_CATALOG_MODE && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  83.                             <div class="content_price 2" itemprop="offers" itemscope itemtype="https://schema.org/Offer">
  84.                                 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
  85.                                     <span itemprop="price" class="price product-price 2">
  86.                                         {* ÁFA beállítása szorzáshoz*}
  87.  
  88.                                         {*if $cart->id_shop_group == 1}
  89.                                             {if $cart->id_shop == 4}
  90.                                                 {assign var="lincos_afa" value='1.19'}
  91.                                             {else}
  92.                                                 {assign var="lincos_afa" value='1.27'}
  93.                                             {/if}
  94.                                         {else}
  95.  
  96.                                             {if $cart->id_shop == 9}
  97.                                                 {assign var="lincos_afa" value='1.20'}
  98.                                             {else}
  99.                                                 {assign var="lincos_afa" value='1.22'}
  100.                                             {/if}
  101.                                             (1+$product.rate/100)
  102.                                         {/if*}
  103.  
  104.                                         {if $cart->id_shop == 6}
  105.                                         {*$product|print_r*}
  106.                                         {/if}
  107.  
  108.  
  109.                                         {hook h="displayProductPriceBlock" product=$product type="before_price"}
  110.                                         {if !$priceDisplay}
  111.                                             {convertPrice price=$product.price}
  112.                                         {else}
  113.                                             <span class="net-price-text">{l s='Net price' mod='lincossearchmodule'}:</span>
  114.                                             <br />
  115.                                             <span class="price-modify net">
  116.                                                 {if isset($smarty.cookies.dev)}{/if}
  117.                                                 {convertPrice price=$product.price_tax_exc}
  118.                                             </span>
  119.                                             {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  120.                                             <br />
  121.                                                 {hook h="displayProductPriceBlock" product=$product type="old_price"}
  122.                                                 <span class="old-price product-price 22">
  123.                                                     {displayWtPrice p=$product.price_without_reduction}
  124.                                                 </span>
  125.                                             {/if}
  126.                                             <br>
  127.                                             <span class="net-price-text">{l s='Gross price' mod='lincossearchmodule'}:</span><br/>
  128.                                             <span class="price-modify brut">
  129.                                             {$product.price}</span>
  130.                                             <br />
  131.                                             {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  132.                                                 {hook h="displayProductPriceBlock" product=$product type="old_price"}
  133.                                                 <span class="old-price product-price 33">
  134.                                                     {$product.price_without_reduction_tax_inc}
  135.                                                 </span>
  136.  
  137.                                             {/if}
  138.  
  139.                                             {if $product.specific_prices.reduction_type == 'percentage'}
  140.                                                 <br />
  141.                                                 <span class="price-percent-reduction 33">-{($product.specific_prices.reduction * 100)|ceil}%</span>
  142.  
  143.                                                 {* Csak akkor mutassa meddig van az akció ha nem örökérvényű *}
  144.                                                 {if ($product.specific_prices.from|substr:0:10) != '0000-00-00'}
  145.                                                     <div class="stock-last">
  146.                                                         <span class="stock-last-date">{str_replace("-", ". ", $product.specific_prices.from|substr:0:10)}. - {str_replace("-", ". ", $product.specific_prices.to|substr:0:10)}., </span>
  147.                                                         <br>
  148.                                                         <span class="stock-last-text">{l s='While stocks last' mod='lincossearchmodule'}</span>
  149.                                                     </div>
  150.                                                 {/if}
  151.                                             {/if}
  152.                                         {/if}
  153.                                     </span>
  154.                                     <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
  155.  
  156.                                     {if $PS_STOCK_MANAGEMENT && isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
  157.                                         <span class="unvisible">
  158.                                             {if ($product.allow_oosp || $product.quantity > 0)}
  159.                                                     <link itemprop="availability" href="https://schema.org/InStock" />{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock' mod='lincossearchmodule'}{/if}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock' mod='lincossearchmodule'}{/if}{/if}
  160.                                             {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
  161.                                                     <link itemprop="availability" href="https://schema.org/LimitedAvailability" />{l s='Product available with different options' mod='lincossearchmodule'}
  162.  
  163.                                             {else}
  164.                                                     <link itemprop="availability" href="https://schema.org/OutOfStock" />{l s='Out of stock' mod='lincossearchmodule'}
  165.                                             {/if}
  166.                                         </span>
  167.                                     {/if}
  168.                                     {hook h="displayProductPriceBlock" product=$product type="price"}
  169.                                     {hook h="displayProductPriceBlock" product=$product type="unit_price"}
  170.                                 {/if}
  171.                             </div>
  172.                         {/if}
  173.                         {if isset($product.new) && $product.new == 1}
  174.                             <a class="new-box" href="{$product.link|escape:'html':'UTF-8'}">
  175.                                 <span class="new-label">{l s='New' mod='lincossearchmodule'}</span>
  176.                             </a>
  177.                         {/if}
  178.                         {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  179.                             <a class="sale-box" href="{$product.link|escape:'html':'UTF-8'}">
  180.                                 <span class="sale-label">{l s='Sale!' mod='lincossearchmodule'}</span>
  181.                             </a>
  182.                         {/if}
  183.                     </div>
  184.                     {if isset($product.is_virtual) && !$product.is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}
  185.                     {hook h="displayProductPriceBlock" product=$product type="weight"}
  186.                 </div>
  187.                 <div class="right-block">
  188.                     <h5 itemprop="name">
  189.                         {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
  190.                         <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" >
  191.                             {$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
  192.                         </a>
  193.                     </h5>
  194.                     {capture name='displayProductListReviews'}{hook h='displayProductListReviews' product=$product}{/capture}
  195.                     {if $smarty.capture.displayProductListReviews}
  196.                         <div class="hook-reviews">
  197.                         {hook h='displayProductListReviews' product=$product}
  198.                         </div>
  199.                     {/if}
  200.                     <p class="product-desc" itemprop="description">
  201.                         {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
  202.                     </p>
  203.                     {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  204.                     <div class="content_price 1">
  205.                         {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
  206.                             {hook h="displayProductPriceBlock" product=$product type='before_price'}
  207.                             <span class="price product-price">
  208.                                 {if $cart->id_shop_group == '3'}
  209.                                     {convertPrice price=$product.price}
  210.                                 {else}
  211.                                     <span class="net-price-text">{l s='Net price' mod='lincossearchmodule'}:</span>
  212.                                     <br />
  213.                                     <span class="price-modify net">
  214.                                         {if isset($smarty.cookies.dev)}{/if}
  215.                                         {convertPrice price=$product.price_tax_exc}
  216.                                     </span>
  217.                                     {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  218.                                         <br />
  219.                                         {hook h="displayProductPriceBlock" product=$product type="old_price"}
  220.                                         <span class="old-price product-price 22">
  221.                                             {displayWtPrice p=$product.price_without_reduction}
  222.                                         </span>
  223.                                     {/if}
  224.                                     <br>
  225.                                     <span class="net-price-text">{l s='Gross price' mod='lincossearchmodule'}:</span><br/>
  226.                                     <span class="price-modify brut">{convertPrice price=$product.price_tax_exc*(1+$product.rate/100)}</span>
  227.                                     <br />
  228.                                     {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  229.                                         {hook h="displayProductPriceBlock" product=$product type="old_price"}
  230.                                         <span class="old-price product-price 33">
  231.                                             {displayWtPrice p=$product.price_without_reduction*(1+$product.rate/100)}
  232.                                         </span>
  233.  
  234.                                     {/if}
  235.  
  236.                                     {if $product.specific_prices.reduction_type == 'percentage'}
  237.                                         <br />
  238.                                         <span class="price-percent-reduction 33">-{($product.specific_prices.reduction * 100)|ceil}%</span>
  239.  
  240.                                         {* Csak akkor mutassa meddig van az akció ha nem örökérvényű *}
  241.                                         {if ($product.specific_prices.from|substr:0:10) != '0000-00-00'}
  242.                                             <div class="stock-last">
  243.                                                 <span class="stock-last-date">{str_replace("-", ". ", $product.specific_prices.from|substr:0:10)}. - {str_replace("-", ". ", $product.specific_prices.to|substr:0:10)}., </span>
  244.                                                 <br>
  245.                                                 <span class="stock-last-text">{l s='While stocks last' mod='lincossearchmodule'}</span>
  246.                                             </div>
  247.                                         {/if}
  248.                                     {/if}
  249.                                 {/if}
  250.  
  251.                             </span>
  252.                             {*if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  253.                                 {hook h="displayProductPriceBlock" product=$product type="old_price"}
  254.                                 <span class="old-price product-price 11">
  255.                                     {if $cart->id_shop_group == '3'}
  256.                                         {displayWtPrice p=$product.price_without_reduction*(1+$product.rate/100)}
  257.                                     {else}
  258.                                         {displayWtPrice p=$product.price_without_reduction}
  259.                                     {/if}
  260.  
  261.                                 </span>
  262.                                 {hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
  263.                                 {if $product.specific_prices.reduction_type == 'percentage'}
  264.                                     <span class="price-percent-reduction 22">-{($product.specific_prices.reduction * 100)|ceil}%</span>
  265.                                 {/if}
  266.                             {/if*}
  267.                             {hook h="displayProductPriceBlock" product=$product type="price"}
  268.                             {hook h="displayProductPriceBlock" product=$product type="unit_price"}
  269.                             {hook h="displayProductPriceBlock" product=$product type='after_price'}
  270.                         {/if}
  271.                     </div>
  272.                     {/if}
  273.                     <div class="button-container">
  274.                         {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE}
  275.                             {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
  276.                                 {capture}add=1&amp;id_product={$product.id_product|intval}{if isset($product.id_product_attribute) && $product.id_product_attribute}&amp;ipa={$product.id_product_attribute|intval}{/if}{if isset($static_token)}&amp;token={$static_token}{/if}{/capture}
  277.                                 <a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart' mod='lincossearchmodule'}" data-id-product-attribute="{$product.id_product_attribute|intval}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity >= 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}">
  278.                                     <span>{l s='Add to cart' mod='lincossearchmodule'}</span>
  279.                                 </a>
  280.                             {else}
  281.                                 <span class="button ajax_add_to_cart_button btn btn-default disabled">
  282.                                     <span>{l s='Add to cart' mod='lincossearchmodule'}</span>
  283.                                 </span>
  284.                             {/if}
  285.                         {/if}
  286.                         <a class="button lnk_view btn btn-default" href="{$product.link|escape:'html':'UTF-8'}" title="{l s='View' mod='lincossearchmodule'}">
  287.                             <span>{if (isset($product.customization_required) && $product.customization_required)}{l s='Customize' mod='lincossearchmodule'}{else}{l s='More' mod='lincossearchmodule'}{/if}</span>
  288.                         </a>
  289.                         <div class="hidden">
  290.                             <pre>
  291.                                 {$product|print_r}
  292.                             </pre>
  293.                         </div>
  294.                     </div>
  295.                     {if isset($product.color_list)}
  296.                         <div class="color-list-container">{$product.color_list}</div>
  297.                     {/if}
  298.                     {if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  299.                         {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
  300.                             <span class="availability">                        
  301.                             {if (($product.allow_oosp || $product.quantity > 0))}
  302.                                 <span class="{if $product.quantity <= 0 && isset($product.allow_oosp) && !$product.allow_oosp} label-danger{elseif $product.quantity <= 0} label-warning{else} label-success{/if}">
  303.                                     {if $product.quantity <= 0}
  304.                                         {if $product.allow_oosp}
  305.                                             {if isset($product.available_later) && $product.available_later}
  306.                                                 {$product.available_later}
  307.                                             {else}
  308.                                                 {l s='In Stock' mod='lincossearchmodule'}
  309.                                             {/if}
  310.                                         {else}
  311.                                             {l s='Out of stock' mod='lincossearchmodule'}
  312.                                         {/if}
  313.                                     {else}
  314.                                         {if isset($product.available_now) && $product.available_now}
  315.                                             {$product.available_now}
  316.                                         {else}
  317.                                             {l s='In Stock' mod='lincossearchmodule'}
  318.                                         {/if}
  319.                                     {/if}
  320.                                 </span>
  321.                             {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
  322.                                 <span class="label-warning">
  323.                                     {l s='Product available with different options' mod='lincossearchmodule'}
  324.                                 </span>
  325.                             {else}
  326.                                 <span class="label-danger">
  327.                                     {l s='Out of stock' mod='lincossearchmodule'}
  328.                                 </span>
  329.                             {/if}                          
  330.                             </span>
  331.                         {/if}
  332.                     {/if}
  333.                 </div>
  334.                 {if $page_name != 'index'}
  335.                     <div class="functional-buttons clearfix">
  336.                         {hook h='displayProductListFunctionalButtons' product=$product}
  337.                         {if isset($comparator_max_item) && $comparator_max_item}
  338.                             <div class="compare">
  339.                                 <a class="add_to_compare" href="{$product.link|escape:'html':'UTF-8'}" data-id-product="{$product.id_product}">{l s='Add to Compare' mod='lincossearchmodule'}</a>
  340.                             </div>
  341.                         {/if}
  342.                     </div>
  343.                 {/if}
  344.             </div><!-- .product-container> -->
  345.         </li>
  346.     {/foreach}
  347.     </ul>
  348. {addJsDefL name=min_item}{l s='Please select at least one product' js=1}{/addJsDefL}
  349. {addJsDefL name=max_item}{l s='You cannot add more than %d product(s) to the product comparison' sprintf=$comparator_max_item js=1}{/addJsDefL}
  350. {addJsDef comparator_max_item=$comparator_max_item}
  351. {addJsDef comparedProductsIds=$compared_products}
  352. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement