Advertisement
Guest User

Untitled

a guest
Nov 14th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 4.46 KB | None | 0 0
  1. {* $Id$ *}
  2. {** block-description:original **}
  3.  
  4. {if $items && !$smarty.request.advanced_filter}
  5.  
  6. {if $smarty.server.QUERY_STRING|strpos:"dispatch=" !== false}
  7.     {assign var="curl" value=$config.current_url}
  8.     {assign var="filter_qstring" value=$curl|fn_query_remove:"result_ids":"filter_id":"view_all":"req_range_id":"advanced_filter":"features_hash":"subcats":"page"}
  9. {else}
  10.     {assign var="filter_qstring" value="products.search"}
  11. {/if}
  12.  
  13. {assign var="reset_qstring" value="products.search"}
  14.  
  15. {if $smarty.request.category_id}
  16.     {assign var="filter_qstring" value=$filter_qstring|fn_link_attach:"subcats=Y"}
  17.     {assign var="reset_qstring" value=$reset_qstring|fn_link_attach:"subcats=Y"}
  18. {/if}
  19.  
  20. {assign var="has_selected" value=false}
  21. {foreach from=$items item="filter" name="filters"}
  22.  
  23.  
  24.  
  25. <h4>{$filter.filter}</h4>
  26.  
  27. <ul class="filtru" id="content_product_more_filters_{$block.block_id}_{$filter.filter_id}">
  28. <select name="$filter.filter" onchange="jQuery.redirect(this.value) ;">
  29.  
  30.              <option value="{$filter.filter}" >-Alege {$filter.filter}-</option>
  31.                 {foreach from=$filter.ranges name="ranges" item="range"}
  32.                {if $range.selected == true}
  33.                         {assign var="fh" value=$smarty.request.features_hash|fn_delete_range_from_url:$range:$filter.field_type}
  34.                         {foreach from=$filter.other_variants item="r"}
  35.                             {assign var="filter_query_elm" value=$fh|fn_add_range_to_url_hash:$r:$filter.field_type}
  36.                             {if $fh}
  37.                                 {assign var="cur_features_hash" value="&amp;features_hash=`$fh`"}
  38.                             {/if}
  39. {assign var="has_selected" value=true}
  40.                             <option value="{if $r.feature_type == "E" && !$r.simple_link && $controller == "product_features"}{"product_features.view?variant_id=`$r.range_id``$cur_features_hash`"|fn_url}{else}{$filter_qstring|fn_link_attach:"features_hash=`$filter_query_elm`"|fn_url}{/if}">{$filter.prefix}{$r.range_name|fn_text_placeholders}{$filter.suffix}</option>
  41. {assign var="has_selected" value=true}
  42.                         {/foreach}
  43.                   {else}
  44.                     {assign var="filter_query_elm" value=$smarty.request.features_hash|fn_add_range_to_url_hash:$range:$filter.field_type}
  45.                         {if $smarty.request.features_hash}
  46.                                 {assign var="cur_features_hash" value="&amp;features_hash=`$smarty.request.features_hash`"}
  47.                         {/if}
  48.                     <option value="{if $filter.feature_type == "E" && !$filter.simple_link}{"product_features.view?variant_id=`$range.range_id``$cur_features_hash`"|fn_url}{else}{$filter_qstring|fn_link_attach:"features_hash=`$filter_query_elm`"|fn_url}{/if}" {if $range.selected}selected="selected"{/if}>{$filter.prefix}{$range.range_name|fn_text_placeholders}{$filter.suffix}</option>
  49.                     {/if}
  50.  
  51.  
  52.                 {/foreach}
  53. </select><div>
  54.  
  55. {$range.selected|@var_dump}
  56.  
  57. <!-- "vezi mai mult"
  58.  
  59. {if $smarty.foreach.ranges.iteration > $smarty.const.FILTERS_RANGES_COUNT}
  60.     <li class="right">
  61.         <a onclick="$('#content_product_more_filters_{$block.block_id}_{$filter.filter_id} li').show(); $('#view_all_{$block.block_id}_{$filter.filter_id}').show(); $(this).hide(); return false;" class="extra-link">{$lang.more}</a>
  62.     </li>
  63. {/if}
  64.  
  65. {if $filter.more_cut}
  66.     {capture name="q"}{$filter_qstring|unescape}&filter_id={$filter.filter_id}&{if $smarty.request.features_hash}&features_hash={$smarty.request.features_hash|fn_delete_range_from_url:$range:$filter.field_type}{/if}{/capture}
  67.     <li id="view_all_{$block.block_id}_{$filter.filter_id}" class="right hidden">
  68.         {assign var="capture_q" value=$smarty.capture.q|escape:url}
  69.         <a href="{"product_features.view_all?q=`$capture_q`"|fn_url}" rel="nofollow" class="extra-link">{$lang.view_all}</a>
  70.     </li>
  71. {/if}
  72.  
  73.  
  74.  
  75. --!>
  76.  
  77. <li class="delim">&nbsp;</li>
  78.  
  79. </ul>
  80.  
  81. {/foreach}
  82.  
  83. <div class="clear filters-tools">
  84.     <div class="float-right"><a {if "FILTER_CUSTOM_ADVANCED"|defined}href="{"products.search?advanced_filter=Y"|fn_url}"{else}href="{$filter_qstring|fn_link_attach:"advanced_filter=Y"|fn_url}"{/if} rel="nofollow" class="secondary-link lowercase">{$lang.advanced}</a></div>
  85.     {if $has_selected}
  86.     <a href="{if $smarty.request.category_id}{"categories.view?category_id=`$smarty.request.category_id`"|fn_url}{else}{$index_script|fn_url}{/if}" rel="nofollow" class="reset-filters">{$lang.reset}</a>
  87.     {/if}
  88. </div>
  89. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement