Igor150195

Умный поиск

Apr 23rd, 2020
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 3.66 KB | None | 0 0
  1. <script>
  2.     var shop2SmartSearchSettings = {ldelim}
  3.         shop2_currency: '{$shop2.currency_shortname}'
  4.     {rdelim}
  5. </script>
  6.  
  7. {literal}
  8. <div id="search-app"  v-on-clickaway="resetData">
  9. {/literal}
  10.     <form action="{get_seo_url uri_prefix=$shop2.uri mode='search'}" enctype="multipart/form-data" id="smart-search-block" class="search-block">{literal}
  11.         <input type="hidden" name="gr_smart_search" value="1">
  12.         <input autocomplete="off" placeholder="#SHOP2_SEARCH#" v-model="search_query" v-on:keyup="searchStart" type="text" name="s[name]" class="search-block__input" id="shop2-name">
  13.         <button class="search-block__btn">#SEARCH#</button>
  14.     </form>
  15.     <div id="search-result" class="custom-scroll scroll-width-thin scroll" v-if="(foundsProduct + foundsFolders + foundsVendors) > 0" v-cloak>
  16.         <div class="search-result-top">
  17.             <div class="search-result-left" v-if="foundsProduct > 0">
  18.                 <div class="result-products">
  19.                     <div class="products-search-title">#PRODUCTS# <span>{{foundsProduct}}</span></div>
  20.                     <div class="product-items">
  21.                         <div class="product-item" v-for='product in products'>
  22.                             <div class="product-image" v-if="product.image_url">
  23.                                 <a v-bind:href="'/'+product.alias">
  24.                                     <img v-bind:src="product.image_url" v-bind:alt="product.name" v-bind:title="product.name">
  25.                                 </a>
  26.                             </div>
  27.                            
  28.                             <div class="product-image no-image" v-else>
  29.                                 <a v-bind:href="'/'+product.alias"></a>
  30.                             </div>
  31.                            
  32.                             <div class="product-text">
  33.                                 <div class="product-name"><a v-bind:href="'/'+product.alias">{{product.name}}</a></div>
  34.                                 <div class="product-text-price">
  35.                                     <div class="price-old" v-if="product.price_old > 0"><strong>{{product.price_old}}</strong> <span>{{shop2SmartSearchSettings.shop2_currency}}</span></div>
  36.                                     <div class="price"><strong>{{product.price}}</strong> <span>{{shop2SmartSearchSettings.shop2_currency}}</span></div>
  37.                                 </div>
  38.                             </div>
  39.                         </div>
  40.                     </div>
  41.                 </div>
  42.             </div>
  43.             <div class="search-result-right" v-if="foundsFolders > 0 || foundsVendors > 0">
  44.                 <div class="result-folders" v-if="foundsFolders > 0">
  45.                     <div class="folders-search-title">#FOLDERS# <span>{{foundsFolders}}</span></div>
  46.                     <div class="folder-items">
  47.                         <div class="folder-item" v-for="folder in foldersSearch">
  48.                             <a v-bind:href="'/'+folder.alias" class="found-folder"><span>{{folder.folder_name}}</span></a>
  49.                         </div>
  50.                     </div>
  51.                 </div>
  52.                 <div class="result-vendors" v-if="foundsVendors > 0">  
  53.                     <div class="vendors-search-title">#SHOP2_VENDORS# <span>{{foundsVendors}}</span></div>
  54.                     <div class="vendor-items">
  55.                         <div class="vendor-item" v-for="vendor in vendorsSearch">
  56.                             <a v-bind:href="vendor.alias" class="found-vendor"><span>{{vendor.name}}</span></a>
  57.                         </div>
  58.                     </div>
  59.                 </div>
  60.             </div>
  61.         </div>
  62.         <div class="search-result-bottom">
  63.             <span class="search-result-btn"><span>#GR_ALL_RESULTS#</span></span>
  64.         </div>
  65.     </div>
  66. </div>
  67. {/literal}
  68.  
  69.  
  70. <script>
  71. var shop2SmartSearch = {ldelim}
  72.         folders: {$smart_search_folders|default:$folders_shared|@json_encode},
  73.         vendors: {$smart_search_vendors|default:$vendors_shared|@json_encode},
  74.         img_width: {$img_width|default:160},
  75.         img_height: {$img_height|default:160},
  76.         limit_products: {$limit_products|default:10}
  77. {rdelim}
  78. </script>
  79. <script src="/g/libs/vue/2.4.3/vue.min.js"></script>
  80. <script src="/g/libs/ba_throttle_debounce/js/jquery.ba_throttle_debounce.min.js"></script>
  81. <script src="/g/libs/vue_clickaway/js/vue_clickaway.min.js"></script>
  82. <script src="images/smart_search/m.smart_search.js"></script>
  83. <link rel="stylesheet" href="images/smart_search/smart_search.scss.css">
Add Comment
Please, Sign In to add comment