Advertisement
valeraplusplus

old_shop2.2.130-product-list-thumbs.tpl

Jul 29th, 2022
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 17.47 KB | None | 0 0
  1. {assign var="show_price" value=0}
  2. {if !(!$user && $shop2.my.hide_prices_non_reg)}
  3.     {assign var="show_price" value=1}
  4. {/if}
  5.  
  6. {assign var="show_price_on_request" value=0}
  7. {if $shop2.my.price_on_request && $product.buy_mode == 1 || ($shop2.price_on_request && $product.price == 0)}
  8.     {assign var="show_price_on_request" value=1}
  9. {/if}
  10.  
  11. {if $product.price_old}
  12.     {assign var="discount" value=$discounts[$product.discounts_applied.0]}
  13. {/if}
  14.  
  15. <form method="post" action="{$shop2.uri}?mode=cart&amp;action=add" accept-charset="utf-8" class="shop2-product-item product-item">
  16.    
  17.     <input type="hidden" name="kind_id" value="{$product.kind_id}" />
  18.     <input type="hidden" name="product_id" value="{$product.product_id}" />
  19.     <input type="hidden" name="meta" value="{$product.meta|@json_encode|htmlspecialchars|escape}" />
  20.  
  21.     <div class="product-item__inner">
  22.  
  23.         <div class="product-item__top">
  24.             {assign var=gr_thumbs_width value=$shop2.my.gr_thumbs_width|default:'450'}
  25.             {assign var=gr_thumbs_height value=$shop2.my.gr_thumbs_height|default:'450'}
  26.  
  27.             <div class="gr-product-image{if !$product.image_filename} no-image{/if}{if $shop2.my.gr_images_size}{if $site.product_settings.images_size=="2" || $smarty.get.gr_images_size == "2"} gr_image_3x4{elseif $site.product_settings.images_size=="3" || $smarty.get.gr_images_size == "3"} gr_image_2x3{elseif $site.product_settings.images_size=="4" || $smarty.get.gr_images_size == "4"} gr_image_4x3{elseif $site.product_settings.images_size=="5" || $smarty.get.gr_images_size == "5"} gr_image_3x2{else} gr_image_1x1{/if}{/if}">
  28.                 <a href="{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}">
  29.                     {if $product.image_filename}
  30.                         {if $shop2.my.gr_images_lazy_load}
  31.                             <img src="/g/spacer.gif" data-src="{s3_img width=$gr_thumbs_width height=$gr_thumbs_height src=$product.image_filename method=$shop2.my.s3_img_method}" class="gr_images_lazy_load{if $site.product_settings.images_view || $smarty.get.gr_images_view == '1'} gr_image_contain{/if}" alt="{$product.name|htmlspecialchars}" title="{$product.name|htmlspecialchars}" />
  32.                         {else}
  33.                             <img src="{s3_img width=$gr_thumbs_width height=$gr_thumbs_height src=$product.image_filename method=$shop2.my.s3_img_method}"{if $site.product_settings.images_view || $smarty.get.gr_images_view == '1'} class="gr_image_contain"{/if} alt="{$product.name|htmlspecialchars}" title="{$product.name|htmlspecialchars}" />
  34.                         {/if}
  35.                     {/if}
  36.                 </a>
  37.                 {if $shop2.my.gr_product_quick_view}
  38.                     <div class="quick-view-trigger" data-url="{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}">
  39.                         <span>
  40.                             {$shop2.my.gr_product_quick_view_text|default:#GR_PRODUCT_QUICK_VIEW#}
  41.                             <i>
  42.                                 <svg class="gr-svg-icon">
  43.                                     <use xlink:href="#icon_shop_preview"></use>
  44.                                 </svg>
  45.                                 <svg class="gr-svg-icon gr_small_icon">
  46.                                     <use xlink:href="#icon_shop_preview_small"></use>
  47.                                 </svg>
  48.                             </i>
  49.                         </span>
  50.                     </div>
  51.                 {/if}
  52.             </div>
  53.             {if $product.new || $product.special || $product.flags || $discount.discount_type == "percent"}
  54.                 <div class="product-flags">
  55.                     <div class="product-flags__left">
  56.                         {if $product.new}<div class="product-flags__item new_item"><span>{$shop2.my.new_alias|default:'New'}</span></div>{/if}
  57.                         {if $product.special}<div class="product-flags__item spec_item"><span>{$shop2.my.special_alias|default:'Sale'}</span></div>{/if}
  58.                     </div>
  59.                     {if $product.flags || $discount.discount_type == "percent"}
  60.                         <div class="product-flags__right">
  61.                             {foreach from=$product.flags item=flag_id key=k name=foo}
  62.                                 {assign var=flag value=$product_flag.$flag_id}
  63.                                 {assign var=spec value=$product.special}
  64.                                 {assign var=new value=$product.new}
  65.                                 {if $smarty.foreach.foo.iteration <= 3}
  66.                                     {if $flag.flag_id != '1' && $flag.flag_id != '2'}
  67.                                         <div class="product-flags__item custom_item">
  68.                                             <span style="background: {$flag.color};" data-custom-bg="{$flag.color}">{$flag.name}</span>
  69.                                         </div>
  70.                                     {/if}
  71.                                 {/if}
  72.                             {/foreach}
  73.                             {if $discount.discount_type == "percent"}
  74.                                 <div class="product-flags__item action_item">
  75.                                     <span>-{$discount.value}%</span>
  76.                                 </div>
  77.                             {/if}
  78.                         </div>
  79.                     {/if}
  80.                 </div>
  81.             {/if}
  82.         </div>
  83.  
  84.  
  85.         <div class="product-item__bottom">
  86.             <div class="product-item__bottom-left">
  87.                
  88.                 <div class="gr-product-name">
  89.                     <a href="{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}">{$product.name}</a>
  90.                 </div>
  91.  
  92.                 {if !$shop2.my.hide_vendor_name && $product.vendor_name !='' && $shop2.my.gr_thumbs_vendor}
  93.                     <div class="gr-vendor-block">
  94.                         <a href="{get_seo_url uri_prefix=$shop2.uri mode="vendor" alias=$product.vendor_alias}">{$product.vendor_name}</a>
  95.                     </div>
  96.                 {/if}
  97.  
  98.                 {include file="global:shop2.2.130-rating.tpl"}
  99.  
  100.                 {include file="global:shop2.2.130-product-article.tpl"}
  101.  
  102.                 {if $product.note}
  103.                     <div class="gr-product-anonce">
  104.                         {$product.note|nl2br}
  105.                     </div>
  106.                 {/if}
  107.  
  108.                 {if $show_price}
  109.                     {include file="global:shop2.2.130-product-actions.tpl"}
  110.                 {/if}
  111.  
  112.                 {include file="global:shop2.2.130-product-options.tpl" meta=$meta}
  113.             </div>
  114.  
  115.             <div class="product-item__bottom-right">
  116.                
  117.                 <div class="product-additional{if !$show_price_on_request && $product.buy_mode == 1} price_on_request{/if}">
  118.                     <div class="product-additional__top">
  119.                         {if $show_price}
  120.                             <div class="product-additional__top-left">
  121.                                 {if $shop2.my.gr_amount_flag}
  122.                                     {*if $product.buy_mode==1}
  123.                                         <div class="gr-amount-flag no_amount">
  124.                                             {if $shop2.my.amount_flag_icon}
  125.                                                 <i>
  126.                                                     <svg class="gr-svg-icon">
  127.                                                         <use xlink:href="#icon_shop_not_available"></use>
  128.                                                     </svg>
  129.                                                     <svg class="gr-svg-icon gr_small_icon">
  130.                                                         <use xlink:href="#icon_shop_not_available_small"></use>
  131.                                                     </svg>
  132.                                                 </i>
  133.                                             {/if}
  134.                                             <span>{$shop2.my.gr_no_amount|default:'Нет в наличии'}</span>
  135.                                         </div>
  136.                                     {elseif $product.buy_mode==2 || $product.buy_mode==3}
  137.                                         <div class="gr-amount-flag pre_order">
  138.                                             {if $shop2.my.amount_flag_icon}
  139.                                                 <i>
  140.                                                     <svg class="gr-svg-icon">
  141.                                                         <use xlink:href="#icon_shop_pre_order"></use>
  142.                                                     </svg>
  143.                                                     <svg class="gr-svg-icon gr_small_icon">
  144.                                                         <use xlink:href="#icon_shop_pre_order_small"></use>
  145.                                                     </svg>
  146.                                                 </i>
  147.                                             {/if}
  148.                                             <span>{$shop2.my.gr_has_amount_pre|default:'Предзаказ'}</span>
  149.                                         </div>
  150.                                     {else}
  151.                                         {if $product.amount>0}
  152.                                             <div class="gr-amount-flag has_amount">
  153.                                                 {if $shop2.my.amount_flag_icon}
  154.                                                     <i>
  155.                                                         <svg class="gr-svg-icon">
  156.                                                             <use xlink:href="#icon_shop_available"></use>
  157.                                                         </svg>
  158.                                                         <svg class="gr-svg-icon gr_small_icon">
  159.                                                             <use xlink:href="#icon_shop_available_small"></use>
  160.                                                         </svg>
  161.                                                     </i>
  162.                                                 {/if}
  163.                                                 <span>{$shop2.my.gr_has_amount|default:'В наличии'}{if $product.amount>0} <ins>{$product.amount}</ins>{/if}</span>
  164.                                             </div>
  165.                                         {/if}
  166.                                     {/if*}
  167.                                     {if $product.amount>0}
  168.                                         <div class="gr-amount-flag has_amount">
  169.                                             {if $shop2.my.amount_flag_icon}
  170.                                                 <i>
  171.                                                     <svg class="gr-svg-icon">
  172.                                                         <use xlink:href="#icon_shop_available"></use>
  173.                                                     </svg>
  174.                                                     <svg class="gr-svg-icon gr_small_icon">
  175.                                                         <use xlink:href="#icon_shop_available_small"></use>
  176.                                                     </svg>
  177.                                                 </i>
  178.                                             {/if}
  179.                                             <span>{$shop2.my.gr_has_amount|default:'В наличии'}{if $product.amount>0} <ins>{$product.amount}</ins>{/if}</span>
  180.                                         </div>
  181.                                     {/if}
  182.                                 {/if}
  183.                                
  184.                                 <div class="product-price">
  185.                                     {if !$show_price_on_request}
  186.                                         {include file="global:shop2.2.130-product-price-old.tpl"}
  187.                                     {/if}
  188.                                     {include file="global:shop2.2.130-product-price.tpl" obj=$product}
  189.                                 </div>
  190.                             </div>
  191.                         {/if}
  192.                         <div class="product-additional__top-right">
  193.                             <div class="product-item-btns">
  194.                                 {*if $shop2.my.gr_info_form}
  195.                                     {if $product.buy_mode!=1}
  196.                                         {include file="global:shop2.2.130-amount-btn.tpl" class="product-amount"}
  197.                                         {if !$show_price_on_request}
  198.                                             {include file="global:shop2.2.130-buy-btn.tpl" type=2}
  199.                                         {/if}
  200.                                     {/if}
  201.                                    
  202.                                     {if $product.buy_mode==1}
  203.                                         <div class="buy-one-click buy_one_click product_info_form{if ($site.product_settings.mode_catalog || $site.gr_settings.mode_catalog) || $smarty.get.gr_mode_catalog == '1'} buy_one_click_action{/if}"
  204.                                             data-remodal-target="buy-one-click"
  205.                                             data-product-link="{$smarty.server.PROTOCOL}://{$smarty.server.HTTP_HOST}{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}"
  206.                                             data-product-name="{$product.name}"
  207.                                             data-api-url="{if $shop2.my.gr_one_click_placeholder}{$product_info_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=1{else}{$product_info_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=0{/if}">
  208.                                             {$shop2.my.gr_product_info_form|default:'Узнать о появлении'}
  209.                                         </div>
  210.                                     {/if}
  211.                                 {else*}
  212.                                     {include file="global:shop2.2.130-amount-btn.tpl" class="product-amount"}
  213.                                     {if !$show_price_on_request}
  214.                                         {include file="global:shop2.2.130-buy-btn.tpl" type=2}
  215.                                     {/if}
  216.                                 {*/if*}
  217.                                 <div class="clear">&nbsp;</div>
  218.                             </div>
  219.                         </div>
  220.                     </div>
  221.                     <div class="product-additional__bottom">
  222.                         {if !$hide_gr_thumbs_one_click}
  223.                             {*if $shop2.my.gr_info_form}
  224.                                 {if $shop2.my.gr_thumbs_one_click && $product.buy_mode!=1}
  225.                                     <div class="buy-one-click buy_one_click{if ($site.product_settings.mode_catalog || $site.gr_settings.mode_catalog) || $smarty.get.gr_mode_catalog == '1'} buy_one_click_action{/if}"
  226.                                         data-remodal-target="buy-one-click"
  227.                                         data-product-link="{$smarty.server.PROTOCOL}://{$smarty.server.HTTP_HOST}{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}"
  228.                                         data-product-name="{$product.name}"
  229.                                         data-api-url="{if $shop2.my.gr_one_click_placeholder}{$one_click_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=1{else}{$one_click_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=0{/if}">
  230.                                         {$shop2.my.gr_one_click_btn|default:'Купить в один клик'}
  231.                                     </div>
  232.                                 {/if}
  233.                             {else*}
  234.                                 {if $shop2.my.gr_thumbs_one_click && $product.buy_mode!=1 && $product.buy_mode!=5}
  235.                                     <div class="buy-one-click buy_one_click{if ($site.product_settings.mode_catalog || $site.gr_settings.mode_catalog) || $smarty.get.gr_mode_catalog == '1'} buy_one_click_action{/if}"
  236.                                         data-remodal-target="buy-one-click"
  237.                                         data-product-link="{$smarty.server.PROTOCOL}://{$smarty.server.HTTP_HOST}{get_seo_url uri_prefix=$shop2.uri mode="product" alias=$product.alias}"
  238.                                         data-product-name="{$product.name}"
  239.                                         data-api-url="{if $shop2.my.gr_one_click_placeholder}{$one_click_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=1{else}{$one_click_form.my_form.postform_api_uri}&param[tpl]=global:shop2.form.minimal.tpl&param[hide_title]=0&param[placeholdered_fields]=0{/if}">
  240.                                         {$shop2.my.gr_one_click_btn|default:'Купить в один клик'}
  241.                                     </div>
  242.                                 {/if}
  243.                             {*/if*}
  244.                             {if $product.buy_mode==5 && $product.amount == 0}
  245.                                 <div class="buy-one-click buy_one_click_action preorder-btn-js preorder-btn"
  246.                                     {if $user.email}data-user-email="{$user.email}"{/if}
  247.                                     data-product-kind_id="{$product.kind_id}"
  248.                                     {*data-remodal-target="buy-one-click"*}
  249.                                 >
  250.                                     {$shop2.my.gr_product_info_form|default:'Узнать о появлении'}
  251.                                 </div>
  252.                             {/if}
  253.                         {/if}
  254.                        
  255.                         {if $shop2.my.gr_favorite}
  256.                             <div class="product-additional__add">
  257.                         {/if}
  258.                             {include file="global:shop2.2.130-product-compare-btn.tpl"}
  259.                         {if $shop2.my.gr_favorite}
  260.                                 {include file="global:shop2.2.130-favorite.tpl" data=$product}
  261.                             </div>
  262.                         {/if}
  263.                     </div>
  264.                 </div>
  265.  
  266.             </div>
  267.         </div>
  268.        
  269.         {if $site.additional_work.schema_org && $shop2.my.gr_schema_org}
  270.             <div itemscope itemtype="{$smarty.server.PROTOCOL}://schema.org/Product" style="display: none;">
  271.                 <meta itemprop="sku" content="{$product.product_id}" />
  272.                 <meta itemprop="name" content="{$product.name}">
  273.                 {if $product.vendor_name}<meta itemprop="brand" content="{$product.vendor_name}">{/if}
  274.                 {if $product.image_filename}<meta itemprop="image" content="{$smarty.server.PROTOCOL}://{$site.domain_mask}{s3_img width=$gr_thumbs_width height=$gr_thumbs_height src=$product.image_filename method=$shop2.my.s3_img_method}">{/if}
  275.                 {assign var="l_shop2_no_description" value="SHOP2_NO_DESCRIPTION"|l}
  276.                 <meta itemprop="description" content="{$product.note|default:$l_shop2_no_description}">
  277.        
  278.                 <div itemprop="offers" itemscope itemtype="{$smarty.server.PROTOCOL}://schema.org/Offer">
  279.                     <meta itemprop="price" content="{$product.price}">
  280.                     <meta itemprop="priceCurrency" content="{$currency.currency_symbol}">
  281.                     {if $product.buy_mode==1}
  282.                         <link itemprop="availability" href="http://schema.org/OutOfStock"/>
  283.                     {else}
  284.                         <link itemprop="availability" href="http://schema.org/InStock"/>
  285.                     {/if}
  286.                     <link itemprop="url" href="{$smarty.server.PROTOCOL}://{$site.domain_mask}{get_seo_url mode="product" alias=$product.alias}">
  287.                 </div>
  288.                 {if $product.rating.value >= 1}
  289.                     <div itemprop="aggregateRating" itemscope itemtype="{$smarty.server.PROTOCOL}://schema.org/AggregateRating">
  290.                         <meta itemprop="ratingValue" content="{$product.rating.value|round}">
  291.                         <meta itemprop="ratingCount" content="{$product.rating.count}">
  292.                         <meta itemprop="bestRating" content="5">
  293.                         <meta itemprop="worstRating" content="1">
  294.                     </div>
  295.                 {/if}
  296.             </div>
  297.         {/if}
  298.  
  299.     </div>
  300.    
  301. </form >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement