Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {if $smarty.get.s.name && $smarty.get.gr_smart_search}
- <div class="smart-search-folders" data-s-name="{$smarty.get.s.name}">
- <div class="smart-search-folders__title">{#FOLDERS#}</div>
- <ul class="smart-search-folders__list menu-default"></ul>
- <script>
- var smart_search_folders_str = /{$smarty.get.s.name}/i;
- var smart_search_folders = "";
- var smart_search_folders_block = document.querySelector('.smart-search-folders');
- var smart_search_folders_container = document.querySelector('.smart-search-folders__list');
- var smart_search_folders_str_length = smart_search_folders_block.getAttribute('data-s-name').length;
- var smart_search_all_folders = {ldelim}
- {foreach from=$folders_shared name=smart_folders_name item=e key=k}
- {if $e.folder_name!=""}
- {$k}: {ldelim}
- "name":"{$e.folder_name}",
- "alias": "{get_seo_url uri_prefix=$shop2.uri mode="folder" alias=$e.alias}",
- {rdelim},
- {/if}
- {/foreach}
- {rdelim};
- for (var key in smart_search_all_folders) {ldelim}
- var name = smart_search_all_folders[key].name;
- var alias = smart_search_all_folders[key].alias;
- if (smart_search_folders_str.test(name)) {ldelim}
- var item = '<li><a href="'+alias+'">'+name+'</a></li>';
- smart_search_folders = smart_search_folders + item;
- {rdelim}
- {rdelim};
- smart_search_folders_container.innerHTML = smart_search_folders;
- if (smart_search_folders=="" || smart_search_folders_str_length<2) {ldelim}
- smart_search_folders_block.remove();
- {rdelim};
- </script>
- </div>
- {/if}
- {if $smarty.get.s.name && $smarty.get.gr_smart_search}
- <div class="smart-search-vendors" data-s-name="{$smarty.get.s.name}">
- <div class="smart-search-vendors__title">{#SHOP2_VENDORS#}</div>
- <ul class="smart-search-vendors__list menu-default"></ul>
- <script>
- var smart_search_vendors_str = /{$smarty.get.s.name}/i;
- var smart_search_vendors = "";
- var smart_search_vendors_block = document.querySelector('.smart-search-vendors');
- var smart_search_vendors_container = document.querySelector('.smart-search-vendors__list');
- var smart_search_vendors_str_length = smart_search_vendors_block.getAttribute('data-s-name').length;
- var smart_search_all_vendors = {ldelim}
- {foreach from=$vendors_shared name=smart_vendors_name item=e key=k}
- {if $e.name!=""}
- {$k}: {ldelim}
- "name":"{$e.name}",
- "alias": "{get_seo_url uri_prefix=$shop2.uri mode="vendor" alias=$e.alias}",
- {rdelim},
- {/if}
- {/foreach}
- {rdelim};
- for (var key in smart_search_all_vendors) {ldelim}
- var name = smart_search_all_vendors[key].name;
- var alias = smart_search_all_vendors[key].alias;
- if (smart_search_vendors_str.test(name)) {ldelim}
- var item = '<li><a href="'+alias+'">'+name+'</a></li>';
- smart_search_vendors = smart_search_vendors + item;
- {rdelim}
- {rdelim};
- smart_search_vendors_container.innerHTML = smart_search_vendors;
- if (smart_search_vendors=="" || smart_search_vendors_str_length<2) {ldelim}
- smart_search_vendors_block.remove();
- {rdelim};
- </script>
- </div>
- {/if}
Add Comment
Please, Sign In to add comment