Advertisement
Igor150195

shop2.2.110-electrical-goods-search-smart.tpl

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