Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var shop2SmartSearchSettings = {ldelim}
- shop2_currency: '{$shop2.currency_shortname}',
- shop2_price_on_request: '{if $shop2.price_on_request}true{/if}',
- shop2_text_price_on_request: '{$shop2.text_price_on_request}'
- {rdelim}
- </script>
- {literal}
- <div id="search-app" class="hide_search_popup" v-on-clickaway="resetData">
- {/literal}
- <form action="{get_seo_url uri_prefix=$shop2.uri mode='search'}" enctype="multipart/form-data" id="smart-search-block" class="search-block">{literal}
- <input type="hidden" name="gr_smart_search" value="1">
- <input autocomplete="off"{/literal}placeholder="{#SHOP2_SEARCH#}" v-model="search_query" v-on:keyup="searchStart" type="text" name="search_text" class="search-block__input" id="shop2-name">
- <button class="search-block__btn">{#SEARCH#}</button>
- </form>
- <div id="search-result" class="custom-scroll scroll-width-thin scroll" v-if="(foundsProduct + foundsFolders + foundsVendors) > 0" v-cloak>
- <div class="search-result-top">
- <div class="search-result-left" v-if="foundsProduct > 0">
- <div class="result-products">
- <div class="products-search-title">{#PRODUCTS#}<span>{ldelim}{ldelim}foundsProduct{rdelim}{rdelim}</span></div>
- <div class="product-items">
- <div class="product-item" v-for='product in products'>
- <div class="product-image" v-if="product.image_url">
- <a v-bind:href="'/'+product.alias">
- <img v-bind:src="product.image_url" v-bind:alt="product.name" v-bind:title="product.name">
- </a>
- </div>
- <div class="product-image no-image" v-else>
- <a v-bind:href="'/'+product.alias"></a>
- </div>
- <div class="product-text">
- <div class="product-name"><a v-bind:href="'/'+product.alias">{ldelim}{ldelim}product.name{rdelim}{rdelim}</a></div>
- <div class="product-text-price" v-if="shop2SmartSearchSettings.shop2_price_on_request && product.price == 0">
- <div class="price"><span>{ldelim}{ldelim}shop2SmartSearchSettings.shop2_text_price_on_request{rdelim}{rdelim}</span></div>
- </div>
- <div class="product-text-price" v-else>
- <div class="price-old" v-if="product.price_old > 0"><strong>{ldelim}{ldelim}product.price_old{rdelim}{rdelim}</strong> <span>{ldelim}{ldelim}shop2SmartSearchSettings.shop2_currency{rdelim}{rdelim}</span></div>
- <div class="price"><strong>{ldelim}{ldelim}product.price{rdelim}{rdelim}</strong> <span>{ldelim}{ldelim}shop2SmartSearchSettings.shop2_currency{rdelim}{rdelim}</span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="search-result-right" v-if="foundsFolders > 0 || foundsVendors > 0">
- <div class="result-folders" v-if="foundsFolders > 0">
- <div class="folders-search-title">{#FOLDERS#}<span>{ldelim}{ldelim}foundsFolders{rdelim}{rdelim}</span></div>
- <div class="folder-items">
- <div class="folder-item" v-for="folder in foldersSearch">
- <a v-bind:href="'/'+folder.alias" class="found-folder"><span>{ldelim}{ldelim}folder.folder_name{rdelim}{rdelim}</span></a>
- </div>
- </div>
- </div>
- <div class="result-vendors" v-if="foundsVendors > 0">
- <div class="vendors-search-title">{#SHOP2_VENDORS#}<span>{ldelim}{ldelim}foundsVendors{rdelim}{rdelim}</span></div>
- <div class="vendor-items">
- <div class="vendor-item" v-for="vendor in vendorsSearch">
- <a v-bind:href="vendor.alias" class="found-vendor"><span>{ldelim}{ldelim}vendor.name{rdelim}{rdelim}</span></a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="search-result-bottom">
- <span class="search-result-btn"><span>{#GR_ALL_RESULTS#}</span></span>
- </div>
- </div>
- </div>
- <script>
- var shop2SmartSearch = {ldelim}
- folders: {$smart_search_folders|default:$folders_shared|@json_encode},
- vendors: {$smart_search_vendors|default:$vendors_shared|@json_encode},
- img_width: {$img_width|default:160},
- img_height: {$img_height|default:160},
- limit_products: {$limit_products|default:10}
- {rdelim}
- </script>
- <script src="/g/libs/vue/2.4.3/vue.min.js"></script>
- <script src="/g/libs/ba_throttle_debounce/js/jquery.ba_throttle_debounce.min.js"></script>
- <script src="/g/libs/vue_clickaway/js/vue_clickaway.min.js"></script>
- <script src="/g/templates/shop2/2.110.2/electrical-goods/additional_work/smart_search/m.smart_search.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement