Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 26.73 KB | None | 0 0
  1. {strip}
  2.  
  3. {$cols = 1} {$is_sidebar_left = 0} {$is_sidebar_right = 0}
  4. {if $theme_settings.product_sidebar_left && (!$wa->isMobile() || ($wa->isMobile() && $wa->cookie("is_desktop_for_mobile") == 1 && $theme_settings.switch_version))}
  5.    {$cols = $cols + 1}
  6.    {$is_sidebar_left = 1}
  7. {/if}
  8. {if $theme_settings.product_sidebar_right && (!$wa->isMobile() || ($wa->isMobile() && $wa->cookie("is_desktop_for_mobile") == 1 && $theme_settings.switch_version))}
  9.    {$cols = $cols + 1}
  10.    {$is_sidebar_right = 1}
  11. {/if}
  12.  
  13. {$is_show_reviews = false}
  14. {if $theme_settings.display_product_card_reviews}
  15.    {$is_show_reviews = true}
  16. {/if}
  17. {$is_show_description = false}
  18. {if $theme_settings.display_product_card_description && $product.description}
  19.    {$is_show_description = true}
  20. {/if}
  21. {$is_show_features = false}
  22. {if $theme_settings.display_product_card_features && $product.features}
  23.    {$is_show_features = true}
  24. {/if}
  25. {$is_show_comments_vk = $theme_settings.product_info_comments_vk_show && $theme_settings.product_info_comments_vk_app_id}
  26. {$is_show_comments_fb = $theme_settings.product_info_comments_fb_show && $theme_settings.product_info_comments_fb_app_id}
  27.  
  28.  
  29. <div class="cols-{$cols}">
  30.    <div class="sidebars-outer">
  31.        {if $is_sidebar_right}
  32.            {include file='sidebar-right.html'}
  33.        {/if}
  34.        {if $is_sidebar_left}
  35.            {include file='sidebar-left.html'}
  36.        {/if}
  37.    </div>
  38.  
  39.    <div id="page-content" class="{if $is_sidebar_left} with-left-sidebar{/if} {if $is_sidebar_right} with-right-sidebar{/if}">
  40.        <article class="product_card" itemscope itemtype="http://schema.org/Product">
  41.            <div class="content">
  42.                <div class="content-block">
  43.                    <div class="display-table">
  44.                        <a class="product_print" href="javascript:window.print()">
  45.                            <span class="link-action-icon icon-before">[`Print`]</span>
  46.                        </a>
  47.                        <h1 class="product_name" itemprop="name">{$product.name|escape}</h1>
  48.                    </div>
  49.                    <div class="display-table">
  50.                        {if $theme_settings.show_product_rates}
  51.                            {if $product.rating > 0}
  52.                                <span class="product_rate rating nowrap" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" title="{sprintf('[`Average user rating: %s / 5`]', $product.rating)}">
  53.                                    {$wa->shop->ratingHtml($product.rating, 16)}
  54.                                    <span itemprop="ratingValue" style="display: none;">{$product.rating}</span>
  55.                                     <span itemprop="reviewCount" style="display: none;">{$reviews_total_count}</span>
  56.                                 </span>
  57.                             {else}
  58.                                 <span class="product_rate rating nowrap">
  59.                                     <i class="icon16 star-empty"></i>
  60.                                     <i class="icon16 star-empty"></i>
  61.                                     <i class="icon16 star-empty"></i>
  62.                                     <i class="icon16 star-empty"></i>
  63.                                     <i class="icon16 star-empty"></i>
  64.                                 </span>
  65.                             {/if}
  66.                         {/if}
  67.  
  68.                         {if $theme_settings.favorites_products || $theme_settings.compare_products}
  69.                             <div class="product_cart-actions">
  70.                                 {if $theme_settings.favorites_products}
  71.                                 {$favorites = $wa->cookie('favorites_list')}
  72.                                 {if $favorites}
  73.                                 {$favorites_list = ","|explode:$favorites}
  74.                                 {else}
  75.                                 {$favorites_list = []}
  76.                                 {/if}
  77.                                 <span data-product="{$product.id}" class="js-add-to-favorites pr-action add-to-favorite {if in_array($product.id, $favorites_list)} active{/if}">
  78.                                     <i class="fa fa-heart"></i>
  79.                                     <span class="pr-action-text">[`To favorites`]</span>
  80.                                 </span>
  81.                                 {/if}
  82.                                 {if $theme_settings.compare_products}
  83.                                 <span data-name="{$product.name|escape}" data-img="{$wa->shop->productImgUrl($product, '60')}" data-url="{$product.frontend_url}" data-product="{$product.id}" class="js-add-to-compare pr-action add-to-compare {if $wa->shop->inComparison($product.id)} active{/if}">
  84.                                     <i class="fa fa-files-o"></i>
  85.                                     <span class="pr-action-text">[`Compare`]</span>
  86.                                 </span>
  87.                                 {/if}
  88.                             </div>
  89.                         {/if}
  90.                     </div>
  91.                 </div>
  92.  
  93.                 <div class="product_main js-product">
  94.                     {include file="product.gallery.html" inline}
  95.                     <div class="product_main-right">
  96.                             <div class="cart ">
  97.                                 {include file="product.cart.html" inline}
  98.                             </div>
  99.  
  100.                             <!-- plugin hook: 'frontend_product.block_aux' -->
  101.                             {* @event frontend_product.%plugin_id%.block_aux *}
  102.                             {if !empty($frontend_product)}
  103.                                 <div class="cart_aux">
  104.                                     {foreach $frontend_product as $_}{$_.block_aux}{/foreach}
  105.                                 </div>
  106.                             {/if}
  107.  
  108.                             <!-- plugin hook: 'frontend_product.menu' -->
  109.                             {* @event frontend_product.%plugin_id%.menu *}
  110.                             {foreach $frontend_product as $_}{$_.menu}{/foreach}
  111.  
  112.  
  113.                             {if $theme_settings.product_card_plugin_hook_block == 'right_block'}
  114.                                 <!-- plugin hook: 'frontend_product.block' -->
  115.                                 {* @event frontend_product.%plugin_id%.block *}
  116.                                 {foreach $frontend_product as $_}{$_.block}{/foreach}
  117.                             {/if}
  118.                     </div>
  119.                 </div>
  120.             </div>
  121.  
  122.             {if $theme_settings.product_infoblocks}
  123.                 {include file="product.bullets.html"}
  124.             {/if}
  125.  
  126.             {$is_normal_tabs = ($theme_settings.product_card_type_main_content == "normal_tabs")}
  127.             {$is_anchor_tabs = ($theme_settings.product_card_type_main_content == "anchor_tabs")}
  128.             {$is_none_tabs = ($theme_settings.product_card_type_main_content == "none_tabs")}
  129.             <div class="content">
  130.                 {if ($is_normal_tabs || $is_anchor_tabs) && ($is_show_description || $is_show_features || $is_show_reviews || count($product.pages) > 0) || $is_show_comments_fb || $is_show_comments_vk}
  131.                    <ul class="tabs js-tabs ul-block">
  132.                        {if $is_show_description}
  133.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if}tabs_el" data-tab-content="product-description">[`Review`]</li>
  134.                        {/if}
  135.                        {if $is_show_features}
  136.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="product-options">[`Characteristics`]</li>
  137.                        {/if}
  138.                        {if $is_show_reviews}
  139.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="product-reviews">[`Reviews`] <span class="hint">({$reviews_total_count})</span></li>
  140.                        {/if}
  141.                        {if $is_show_comments_vk}
  142.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="comments-vk">
  143.                                {if $theme_settings.product_info_comments_vk_title}{$theme_settings.product_info_comments_vk_title}{else}[`Discussions`]{/if}
  144.                                <i class="fa fa-vk tabs_el-vk" aria-hidden="true"></i>
  145.                            </li>
  146.                        {/if}
  147.                        {if $is_show_comments_fb}
  148.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="comments-fb">
  149.                                {if $theme_settings.product_info_comments_fb_title}{$theme_settings.product_info_comments_fb_title}{else}[`Discussions`]{/if}</span>
  150.                                <i class="fa fa-facebook-f tabs_el-fb"></i>
  151.                            </li>
  152.                        {/if}
  153.                        {if count($product.pages) > 0}
  154.                            {foreach $product.pages as $page}
  155.                                <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="product-page-{$page.id}">{$page.name|escape}</li>
  156.                            {/foreach}
  157.                        {/if}
  158.                        {if $theme_settings.product_add_info_title}
  159.                            <li class="{if $is_normal_tabs}js-tab {/if}{if $is_anchor_tabs}js-move-to-tab {/if} tabs_el" data-tab-content="product-page-addinfo">{$theme_settings.product_add_info_title|escape}</li>
  160.                        {/if}
  161.                    </ul>
  162.                {/if}
  163.  
  164.                {if $is_show_description || $is_show_features || $is_show_reviews || count($product.pages) > 0 || $is_show_comments_fb || $is_show_comments_vk}
  165.                    <div class="tab-contents">
  166.                        {if $is_show_description}
  167.                            <div id="product-description" class="js-tab-content content-block product_description{if $is_normal_tabs} tab-content_el{/if}">
  168.                                {if $wa->isMobile() || empty($is_normal_tabs)}
  169.                                    <div class="product-tab_head"><h2>[`Description`]</h2></div>
  170.                                {/if}
  171.                                {if $theme_settings.product_card_show_brand_content && $theme_settings.plugin_brands == 'brands_pro' && class_exists('shopBrandViewHelper')}
  172.                                    {$_brand_pro = shopBrandViewHelper::getProductBrand($product)}
  173.                                    {if !empty($_brand_pro) && $_brand_pro.image_url}
  174.                                        <div class="product_desc-brand">
  175.                                            <a class="product_brand-img" href="{$_brand_pro.frontend_url}"><img alt="{$_brand_pro.name|escape}" src="{$_brand_pro.image_url}"></a>
  176.                                        </div>
  177.                                    {/if}
  178.                                {else if $theme_settings.product_card_show_brand_content && $theme_settings.plugin_brands == 'brands' && class_exists('shopProductbrandsPlugin')}
  179.                                    {$_b = shopProductbrandsPlugin::productBrand($product.id)}
  180.                                    {if !empty($_b) && $_b.image}
  181.                                        <div class="product_desc-brand">
  182.                                            <a class="product_brand-img" href="{$_b.url}"><img alt="{$_b.name|escape}" src="{$wa_url}wa-data/public/shop/brands/{$_b.id}/{$_b.id}.200{$_b.image}"></a>
  183.                                        </div>
  184.                                    {/if}
  185.                                {/if}
  186.                                <div itemprop="description">{$product.description}</div>
  187.                            </div>
  188.                         {/if}
  189.                        {if $is_show_features}
  190.                            <div id="product-options" class="js-tab-content content-block {if $is_normal_tabs} tab-content_el{/if}">
  191.                                {if $wa->isMobile() || $is_normal_tabs != 1}
  192.                                    <div class="product-tab_head"><h2>[`Characteristics`]</h2></div>
  193.                                {/if}
  194.                                <table class="product_features">
  195.                                    {$product_features_list = $product.features}
  196.                                    {if class_exists('shopGroupattrPlugin')}
  197.                                        {$product_features_list = shopGroupattrPlugin::process($product, $features)}
  198.                                    {/if}
  199.                                    {if class_exists('shopSeofilterViewHelper')}
  200.                                        {$product_features_list = shopSeofilterViewHelper::wrapFeatureValues($product_features_list)}
  201.                                    {/if}
  202.                                    {foreach $product_features_list as $f_code => $f_value}
  203.                                        <tr class="product_features-item {if $features[$f_code].type == 'divider'} divider{/if}">
  204.                                            <td class="product_features-title">
  205.                                                <span>{$features[$f_code].name|escape}</span>
  206.                                            </td>
  207.                                            {$_is_good_param = ($f_code|in_array:["weight", "model", "width", "height", "depth", "color", "manufacturer"])}
  208.                                            {$_itemprop = ""}
  209.                                            {if $_is_good_param}
  210.                                                {$_itemprop = $f_code}
  211.                                            {/if}
  212.                                            {if $theme_settings.feature_brand_code && $theme_settings.feature_brand_code == $f_code}
  213.                                                {$_itemprop = "brand"}
  214.                                            {/if}
  215.                                            <td class="product_features-value"{if $_itemprop} itemprop="{$_itemprop}"{/if}>
  216.                                                {if is_array($f_value)}
  217.                                                    {if $features[$f_code].type == 'color'}
  218.                                                        {implode('<br /> ', $f_value)}
  219.                                                    {else}
  220.                                                        {implode(', ', $f_value)}
  221.                                                    {/if}
  222.                                                {else}
  223.                                                    {$f_value}
  224.                                                {/if}
  225.                                            </td>
  226.                                        </tr>
  227.                                    {/foreach}
  228.                                </table>
  229.                            </div>
  230.                        {/if}
  231.                        {if $is_show_reviews}
  232.                            <section id="product-reviews" class="js-tab-content content-block{if $is_normal_tabs} tab-content_el{/if}">
  233.                                <h2>{sprintf('[`%s reviews`]', $product.name|escape)}</h2>
  234.  
  235.                                {if !empty($rates)}
  236.                                <p class="rating">
  237.                                    [`Average customer rating:`]
  238.                                    <span class="nowrap">{$wa->shop->ratingHtml($product.rating, 16)}</span> (<a href="reviews/">{$reviews_total_count}</a>)
  239.                                    {if $product.rating > 0}<span class="hint product_rate-count">{sprintf('[`%s out of 5 stars`]', $product.rating)}</span>{/if}
  240.                                </p>
  241.  
  242.                                <table class="rating-distribution">
  243.                                    {$_total_count = 0}
  244.                                    {foreach $rates as $_rate => $_count}
  245.                                    {$_total_count = $_total_count + $_count}
  246.                                    {/foreach}
  247.                                    {* foreach $rates as $_rate => $_count *}
  248.                                    {for $i = 5 to 0 step -1}
  249.                                    {if empty($rates[$i]) || !$rates[$i]}{$_count = 0}{else}{$_count = $rates[$i]}{/if}
  250.                                    {if $i || $_count}
  251.                                    <tr>
  252.                                        <td class="min-width hint">{$_count}</td>
  253.                                        <td>
  254.                                            <div class="bar">
  255.                                                <div class="filling bg-sd-color" style="width: {if $_total_count > 0}{str_replace(',','.', 100*$_count/$_total_count)}{else}0{/if}%;{if !$i} background: #ddd;{/if}"></div>
  256.                                             </div>
  257.                                         </td>
  258.                                         <td>
  259.                                             <span class="rating">{for $j=1 to $i}<i class="icon10 star"></i>{forelse}<span class="hint">[`no rate`]</span>{/for}</span>
  260.                                         </td>
  261.                                     </tr>
  262.                                     {/if}
  263.                                     {/for}
  264.                                 </table>
  265.                                 {/if}
  266.                                 <div class="js-reviews-content" data-url-product="{$wa->shop->productUrl($product)}">
  267.                                     {if $reviews}
  268.                                         {foreach $reviews as $review}
  269.                                             {include file="review.html" inline}
  270.                                         {/foreach}
  271.                                     {else}
  272.                                         [`About this product reviews yet. Be the first!`]
  273.                                     {/if}
  274.                                 </div>
  275.                             </section>
  276.                         {/if}
  277.                         {if $is_show_comments_vk}
  278.                             <div class="content-block js-tab-content{if $is_normal_tabs} tab-content_el{/if}" id="comments-vk">
  279.                                 {include file="`$wa_active_theme_path`/product.comments.vk.html"}
  280.                             </div>
  281.                         {/if}
  282.                         {if $is_show_comments_fb}
  283.                             <div class="content-block js-tab-content{if $is_normal_tabs} tab-content_el{/if}" id="comments-fb">
  284.                                 {include file="`$wa_active_theme_path`/product.comments.fb.html"}
  285.                             </div>
  286.                         {/if}
  287.                         {if count($product.pages) > 0}
  288.                             {foreach $product.pages as $page}
  289.                                 <div id="product-page-{$page.id}" class="js-tab-content content-block{if $is_normal_tabs} tab-content_el{/if}">
  290.                                     {if $wa->isMobile() || $is_normal_tabs != 1}
  291.                                         <div class="product-tab_head"><h2>{$page.name|escape}</h2></div>
  292.                                     {/if}
  293.                                     {$page.content}
  294.                                 </div>
  295.                             {/foreach}
  296.                         {/if}
  297.                         {if $theme_settings.product_add_info_title}
  298.                             <div id="product-page-addinfo" class="content-block{if $is_normal_tabs} js-tab-content tab-content_el{/if}">
  299.                                 {$wa->block("product_addinfo")}
  300.                             </div>
  301.                         {/if}
  302.                     </div>
  303.                 {/if}
  304.  
  305.                 {if $theme_settings.product_card_plugin_hook_block != 'right_block'}
  306.                     {* @event frontend_product.%plugin_id%.block *}
  307.                     {foreach $frontend_product as $_}
  308.                         {$_.block}
  309.                     {/foreach}
  310.                 {/if }
  311.                 {if ($theme_settings.show_product_categories && count($product.categories) > 1) || ($theme_settings.show_product_tags && $product.tags)}
  312.                    <div class="content-block">
  313.                        <!-- categories -->
  314.                        {if $theme_settings.show_product_categories && count($product.categories) > 1}
  315.                            <div class="product_categories">
  316.                                [`Categories`]:
  317.                                {foreach $product.categories as $c}{if $c.status}
  318.                                <a href="{$wa->getUrl('/frontend/category', ['category_url' => $c.full_url])}">{$c.name|escape}</a>
  319.                                {/if}{/foreach}
  320.                            </div>
  321.                        {/if}
  322.  
  323.                        <!-- tags -->
  324.                        {if $theme_settings.show_product_tags && $product.tags}
  325.  
  326.                            <div class="product_tags">
  327.                                [`Tags`]:
  328.  
  329.                                <span class="tags cloud bs-color">
  330.                                    {if class_exists('shopTageditorPlugin')}
  331.                                         {foreach shopTageditorPlugin::tags($product.tags) as $t}
  332.                                            <a href="{$wa->getUrl('/frontend/tag', ['tag' => $t.uri_name])}">{$t.name|escape}</a>
  333.                                         {/foreach}
  334.                                    {else}
  335.                                       {foreach $product.tags as $t}
  336.                                            <a href="{$wa->getUrl('/frontend/tag', ['tag' => urlencode($t)])}">{$t}</a>
  337.                                        {/foreach}
  338.                                    {/if}
  339.                                </span>
  340.                            </div>
  341.                        {/if}
  342.                    </div>
  343.                {/if}
  344.            </div>
  345.        </article>
  346.  
  347.        {$count_crossselling = (int) $theme_settings.crossselling_count}
  348.        {if empty($count_crossselling)}{$count_crossselling = 12}{/if}
  349.        {$crossselling = $product->crossSelling($count_crossselling)}
  350.  
  351.        {$count_upselling = (int) $theme_settings.upselling_count}
  352.        {if empty($count_upselling)}{$count_upselling = 12}{/if}
  353.        {$upselling = $product->upSelling($count_upselling)}
  354.  
  355.        {$viewed_list = $wa->cookie('viewed_list')}
  356.  
  357.        {if isset($theme_settings.product_card_list_view_type) && !empty($theme_settings.product_card_list_view_type)}
  358.            {$CategoryProductsView = $theme_settings.product_card_list_view_type}
  359.        {/if}
  360.  
  361.        {if $crossselling || $upselling || ( $theme_settings.viewed_products && $theme_settings.product_card_views_products && $viewed_list)}
  362.            <div class="content product_related-products">
  363.                {if $crossselling}
  364.                    <section>
  365.                        <div class="product_related-title__outer">
  366.                            <h3 class="product_related-title">{sprintf('[`Customers who bought %s also bought`]', $product.name|escape)}</h3>
  367.                        </div>
  368.                        {if $wa->isMobile() && !($wa->cookie("is_desktop_for_mobile") == 1 && $theme_settings.switch_version)}
  369.                            {include file="list-thumbs-mini.html" products=$crossselling ulclass=""}
  370.                        {else}
  371.                            {include file="list-thumbs.html" products=$crossselling ulclass=""}
  372.                        {/if}
  373.                    </section>
  374.                {/if}
  375.                {if $upselling}
  376.                    <section>
  377.                        <div class="product_related-title__outer">
  378.                            <h3 class="product_related-title">
  379.                                [`See also`]
  380.                                {$compare_ids = array_merge(array($product.id), array_keys($upselling))}
  381.                                <a class="product_related-compare sd-color link-half" onClick="javascript:window.location='{$wa->getUrl('/frontend/compare', ['id' => implode(',', $compare_ids)])}';">[`Compare all`]</a>
  382.                             </h3>
  383.                         </div>
  384.                         {if $wa->isMobile()  && !($wa->cookie("is_desktop_for_mobile") == 1 && $theme_settings.switch_version)}
  385.                            {include file="list-thumbs-mini.html" products=$upselling ulclass=""}
  386.                        {else}
  387.                            {include file="list-thumbs.html" products=$upselling ulclass=""}
  388.                        {/if}
  389.                    </section>
  390.                {/if}
  391.  
  392.                {if $theme_settings.viewed_products && $viewed_list && ($theme_settings.product_card_views_products || $wa->isMobile())}
  393.                    {$viewed_list_arr = ","|explode:$viewed_list}
  394.                    {$viewed_list_arr_lasted = []}
  395.                    {$counter = 1}
  396.                    {foreach $viewed_list_arr as $id}
  397.                        {$viewed_list_arr_lasted[] = $id}
  398.                        {if $counter++ == 5}
  399.                            {break}
  400.                        {/if}
  401.                    {/foreach}
  402.                    {$products = $wa->shop->products($viewed_list_arr_lasted)}
  403.                    {$products_result = []}
  404.                    {foreach $viewed_list_arr as $id}
  405.                        {foreach $products as $product}
  406.                            {if $product.id == $id}
  407.                                {$products_result[$id] = $product}
  408.                            {/if}
  409.                        {/foreach}
  410.                    {/foreach}
  411.                    <section>
  412.                        <div class="product_related-title__outer">
  413.                            <h3 class="product_related-title">[`Viewed products`]</h3>
  414.                        </div>
  415.                        {if $wa->isMobile() && !($wa->cookie("is_desktop_for_mobile") == 1 && $theme_settings.switch_version)}
  416.                            {include file="list-thumbs-mini.html" products=$products_result ulclass=""}
  417.                        {else}
  418.                            {include file="list-thumbs.html" products=$products_result ulclass=""}
  419.                        {/if}
  420.                    </section>
  421.                {/if}
  422.            </div>
  423.        {/if}
  424.    </div>
  425. </div>
  426.  
  427. <script>
  428.    ( function($) {
  429.        var url = $('.js-reviews-content').data("url-product").replace(/\/#\/[^#]*|\/#|\/$/g, '') + '/reviews/';
  430.         $.get(url, function(data) {
  431.             var content = $(data).find('.js-reviews-outer');
  432.             $('.js-reviews-content').html(content);
  433.         });
  434.     })(jQuery);
  435. </script>
  436.  
  437.  
  438. {/strip}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement