Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.54 KB | None | 0 0
  1. {*
  2. storefront homepage
  3. *}
  4.  
  5. {if $theme_settings.homepage_sidebar_layout != 'hidden'}
  6. <div class="sidebar{if $theme_settings.homepage_sidebar_layout == 'left'} left-sidebar{/if}">
  7.  
  8. <!-- CONTACT INFO -->
  9. {if $theme_settings.homepage_sidebar_storeinfo}
  10. <figure class="store-info">
  11. <h1 itemprop="name">{$wa->shop->settings('name')}</h1>
  12. <h3>
  13. <span itemprop="telephone">{$wa->shop->settings('phone')}</span>
  14. {if !method_exists($wa->shop, 'schedule')}
  15. {if $wh = $wa->shop->settings('workhours')}<br>
  16. <span class="hint">{$wh.days_from_to}{if $wh.hours_from && $wh.hours_to} {$wh.hours_from}—{$wh.hours_to}{/if}</span>
  17. {/if}
  18. {/if}
  19. </h3>
  20. {strip}
  21. {if !empty($theme_settings.use_shop_schedule) && method_exists($wa->shop, 'schedule')}
  22. {$_schedule = $wa->shop->schedule()}
  23.  
  24. <div class="s-schedule-wrapper" id="js-schedule-wrapper">
  25. <div class="s-visible">
  26. <div class="s-label-wrapper js-show-schedule" title="[`Business hours`]">
  27. [`Business hours`] <i class="s-icon"></i>
  28. </div>
  29. </div>
  30. <div class="s-hidden">
  31. <div class="s-days-wrapper">
  32. {foreach $_schedule.current_week as $_day}
  33. <div class="s-day-wrapper">
  34. <div class="s-date">{$_day.name|escape}</div>
  35. <div class="s-value">
  36. {if !empty($_day.work)}
  37. <div class="s-time">{$_day.start_work|escape} — {$_day.end_work|escape}</div>
  38. {else}
  39. <div class="s-text">[`day off`]</div>
  40. {/if}
  41. </div>
  42. </div>
  43. {/foreach}
  44. </div>
  45. <i class="s-close-icon js-close-schedule" title="[`Close`]"></i>
  46. </div>
  47.  
  48. <script>
  49. ( function($) {
  50. var $wrapper = $("#js-schedule-wrapper");
  51.  
  52. var open_class = "is-open";
  53.  
  54. $wrapper.on("click", ".js-show-schedule", function(event) {
  55. event.preventDefault();
  56. $wrapper.toggleClass(open_class);
  57. });
  58.  
  59. $wrapper.on("click", ".js-close-schedule", function(event) {
  60. event.preventDefault();
  61. $wrapper.removeClass(open_class);
  62. });
  63.  
  64. $(document).on("click", clickWatcher);
  65. function clickWatcher(event) {
  66. var is_exist = $.contains(document, $wrapper[0]);
  67. if (is_exist) {
  68. var is_target = $.contains($wrapper[0], event.target);
  69. if (!is_target) {
  70. if ($wrapper.hasClass(open_class)) {
  71. $wrapper.removeClass(open_class);
  72. }
  73. }
  74. } else {
  75. $(document).off("click", clickWatcher);
  76. }
  77. }
  78.  
  79. $(document).on("keyup", keyWatcher);
  80. function keyWatcher(event) {
  81. var is_exist = $.contains(document, $wrapper[0]);
  82. if (is_exist) {
  83. var is_escape = (event.keyCode === 27);
  84. if (is_escape) {
  85. if ($wrapper.hasClass(open_class)) {
  86. $wrapper.removeClass(open_class);
  87. }
  88. }
  89. } else {
  90. $(document).off("click", keyWatcher);
  91. }
  92. }
  93. })(jQuery);
  94. </script>
  95. </div>
  96.  
  97. {elseif !empty($theme_settings.manual_schedule)}
  98. <div class="s-schedule-wrapper">
  99. <div class="s-visible">
  100. <div class="s-label-wrapper">
  101. <span class="s-text">{$theme_settings.manual_schedule|escape}</span>
  102. </div>
  103. </div>
  104. </div>
  105. {/if}
  106. {/strip}
  107.  
  108. <meta itemprop="address" content="{$wa->shop->settings('country')}">
  109. <meta itemprop="currenciesAccepted" content="{$wa->shop->currency()}">
  110. </figure>
  111. {/if}
  112.  
  113. <!-- ROOT CATEGORIES -->
  114. {if $theme_settings.homepage_sidebar_categories}
  115. {$categories = $wa->shop->categories(0, 0, true)}
  116. {if count($categories)}
  117. <ul class="tree">
  118. {foreach $categories as $cat}
  119. <li>
  120. <a href="{$cat.url}">{$cat.name}</a>
  121. </li>
  122. {/foreach}
  123. </ul>
  124. {/if}
  125. {/if}
  126.  
  127. <!-- BULLETS -->
  128. <section class="bullets">
  129. {if !empty($theme_settings.homepage_bullet_title_1)}
  130. <figure class="bullet">
  131. <h4><span class="b-glyph b-shipping"></span> {$theme_settings.homepage_bullet_title_1}</h4>
  132. <p>{$theme_settings.homepage_bullet_body_1}</p>
  133. </figure>
  134. {/if}
  135. {if !empty($theme_settings.homepage_bullet_title_2)}
  136. <figure class="bullet">
  137. <h4><span class="b-glyph b-payment"></span> {$theme_settings.homepage_bullet_title_2}</h4>
  138. <p>{$theme_settings.homepage_bullet_body_2}</p>
  139. </figure>
  140. {/if}
  141. {if !empty($theme_settings.homepage_bullet_title_3)}
  142. <figure class="bullet">
  143. <h4><span class="b-glyph b-location"></span> {$theme_settings.homepage_bullet_title_3}</h4>
  144. <p>{$theme_settings.homepage_bullet_body_3}</p>
  145. </figure>
  146. {/if}
  147. </section>
  148.  
  149. <!-- FOLLOW -->
  150. <aside class="connect">
  151. {if !empty($theme_settings.facebook_likebox_code)}
  152. <div class="likebox">
  153. {$theme_settings.facebook_likebox_code}
  154. </div>
  155. {/if}
  156. {if !empty($theme_settings.twitter_timeline_code)}
  157. <div class="likebox">
  158. {$theme_settings.twitter_timeline_code}
  159. </div>
  160. {/if}
  161. {if !empty($theme_settings.vk_widget_code)}
  162. <div class="likebox">
  163. {$theme_settings.vk_widget_code}
  164. </div>
  165. {/if}
  166. {*
  167. <div class="likebox">
  168. your custom social widget
  169. </div>
  170. *}
  171. </aside>
  172.  
  173. </div>
  174. {/if}
  175.  
  176. <div class="content{if $theme_settings.homepage_sidebar_layout != 'hidden'} with-sidebar{/if}{if $theme_settings.homepage_sidebar_layout == 'left'} left-sidebar{/if}">
  177.  
  178. {$promocards = $wa->shop->promos('link', '900')}
  179. {$bestsellers = $wa->shop->productSet( $theme_settings.homepage_productset_bestsellers )}
  180.  
  181. {if $theme_settings.homepage_bxslider_mode !== 'promos' && $theme_settings.homepage_bxslider_mode !== 'hidden'}
  182. {$promoproducts = $wa->shop->productSet( $theme_settings.homepage_productset_promo )}
  183. {/if}
  184.  
  185. {if empty($promocards) && empty($promoproducts) && empty($bestsellers)}
  186.  
  187. <article class="welcome">
  188. <h1>[`Welcome to your new online store!`]</h1>
  189. <p>{sprintf('[`Start by <a href="%s">creating a product</a> in your store backend.`]', $wa_backend_url|cat:'shop/?action=products#/welcome/')}</p>
  190. <style>
  191. .page-content.with-sidebar { margin-left: 0; border-left: 0; }
  192. </style>
  193. </article>
  194.  
  195. {elseif $theme_settings.homepage_bxslider_mode != 'hidden'}
  196.  
  197. <!-- SLIDER -->
  198. {include file="./home.slider.html" inline}
  199. {/if}
  200.  
  201. {if $promocards && $theme_settings.homepage_promocards_below_the_slider}
  202. <!-- PROMOS -->
  203. <section class="promos">
  204. <ul>
  205. {foreach $promocards as $promo}<li id="s-promo-{$promo.id}">
  206. <a href="{$promo.link|escape}" style="background-image: url('{$promo.image}');">
  207. <div class="background-color-layer"></div>
  208. {if !empty($promo.title)}<h5 style="color: {$promo.color};">{$promo.title|escape}</h5>{/if}
  209. {* if !empty($promo.body)}<p style="color: {$promo.color};">{$promo.body|escape}</p>{/if *}
  210. </a>
  211. </li>{/foreach}
  212. </ul>
  213. </section>
  214. {/if}
  215.  
  216. <!-- plugin hook: 'frontend_homepage' -->
  217. {* @event frontend_homepage.%plugin_id% *}
  218. {foreach $frontend_homepage as $_}{$_}{/foreach}
  219.  
  220. <!-- BESTSELLERS product list -->
  221. {if $bestsellers}
  222.  
  223. <section class="bestsellers">
  224. {if $theme_settings.homepage_bestsellers_title}
  225. <h5 class="bestsellers-header">{str_replace('{$date}', $smarty.now|wa_datetime:"humandate", $theme_settings.homepage_bestsellers_title)}</h5>
  226. {/if}
  227. {include file="list-thumbs.html" products=$bestsellers}
  228. </section>
  229.  
  230. {else}
  231. <p class="hint align-center"><br><em>{sprintf('[`In your store backend, drag some products into <strong>%s</strong> product list (which is in the left sidebar of the Products screen), and these products will be automatically published here — right on your storefront homepage.`]', $theme_settings.homepage_productset_bestsellers|escape|default:'()' )}</em></p>
  232. {/if}
  233.  
  234. </div>
  235.  
  236. <div class="clear-both"></div>
  237.  
  238. <!-- WELCOME note -->
  239. {if !empty($theme_settings.homepage_welcome_note)}
  240. <figure class="olives">
  241. <div class="olives-left">
  242. <div class="olives-right">
  243. <div class="olives-content">
  244. {$theme_settings.homepage_welcome_note}
  245. </div>
  246. </div>
  247. </div>
  248. </figure>
  249. {/if}
  250.  
  251. <!-- ON SALE product list -->
  252. {if !empty($theme_settings.homepage_productset_onsale)}
  253.  
  254. {$onsale = $wa->shop->productSet( $theme_settings.homepage_productset_onsale )}
  255.  
  256. {if !empty($onsale)}
  257. <section class="onsale related">
  258. {if $theme_settings.homepage_onsale_title}
  259. <h4 class="section-header">{str_replace('{$date}', $smarty.now|wa_datetime:"humandate", $theme_settings.homepage_onsale_title)}</h4>
  260. {/if}
  261. {include file="list-thumbs-mini.html" products=$onsale ulclass="onsale-bxslider"}
  262. </section>
  263. {/if}
  264.  
  265. {/if}
  266.  
  267. <!-- BLOG posts -->
  268. {if $theme_settings.homepage_blogposts && $wa->blog}
  269.  
  270. {$blog_posts = $wa->blog->posts(null,4)}
  271. {if count($blog_posts)}
  272.  
  273. <h4 class="section-header">[`Latest blog updates`]</h4>
  274. <ul class="thumbs text-content">
  275. {foreach $blog_posts as $post}
  276. <li>
  277. <a href="{$post.link}" class="bold">{$post.title}</a>
  278. <p class="small">{strip_tags($post.text)|truncate:128}</p>
  279. <span class="hint">{$post.datetime|wa_datetime:"humandate"}</span>
  280. </li>
  281. {/foreach}
  282. </ul>
  283. {/if}
  284. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement