Интеграция в тему TOP SHOP

1

Вот код файла

<h4>list-thumbs.html</h4>

, куда нужно вставить {shopSaleskuPluginView::displayOptions($p)}

чтобы все работало корректно

{strip}

{$favorite_p = waRequest::cookie("shop_favorite", '', waRequest::TYPE_STRING)}

{assign var=favorite_p_split value=","|explode:$favorite_p}

{if isset($microsheme)}{$microsheme = false}{else}{$microsheme = true}{/if}

{foreach $products as $p}

isMobile()}hover-active{/if}" {if="" $wa-="">get("view") == 'favorite'}data-type="favorite"{/if} {if $microsheme}itemscope itemtype ="http://schema.org/Product"{/if}>

<div class="thumbnail-catalog one-product">

<form class="flexdiscount-product-form" data-preview="{$p.frontend_url}{if strpos($p.frontend_url, '?')}&{else}?{/if}cart=1" {if $p.sku_count > 1}data-url="{$p.frontend_url}{if strpos($p.frontend_url, '?')}&{else}?{/if}cart=1"{/if} method="post" action="{$wa->getUrl('/frontendCart/add')}">

<input type="hidden" name="product_id" value="{$p.id}">

{$badge_html = $wa->shop->badgeHtml($p.badge)}

{if $badge_html}

<div class="badge-block">

{$badge_html}

{if $p.compare_price > 0}

<div class="badge discount">{$percent = 100-($p.price/$p.compare_price)*100}-{$percent|round:0}%</div>

{/if}

</div>

{else}

<div class="badge-block">

{if $p.compare_price > 0}

<div class="badge discount">{$percent = 100-($p.price/$p.compare_price)*100}-{$percent|round:0}%</div>

{/if}

</div>

{/if}

<div class="image-block">

<div class="zoom-image">

{if $microsheme}

<a href="{$p.frontend_url}" title="{$p.name}{if $p.summary} – {strip_tags($p.summary)|escape}{/if}">{$wa->shop->productImgHtml($p, '400', ['itemprop' => 'image', 'alt' => $p.name, 'default' => "`$wa_theme_url`img/no-foto-catalog.gif"])}</a>

{else}

<a href="{$p.frontend_url}" title="{$p.name}{if $p.summary} – {strip_tags($p.summary)|escape}{/if}">{$wa->shop->productImgHtml($p, '400', ['alt' => $p.name, 'default' => "`$wa_theme_url`img/no-foto-catalog.gif"])}</a>

{/if}

</div>

<div class="preview"><i class="fa fa-search-plus"></i></div>

<div class="compare-favorite">

{if isset($actions) != 'favorite'}

<span class="compare-favorite-icon{if in_array($p.id, $favorite_p_split)} active{/if}"><i class="fa fa-heart-o"></i> <a href="#" data-product="{$p.id}" class="favorite-link">[`favorite`]</a></span>

{/if}

<span class="compare-compare-icon{if $wa->shop->inComparison($p.id)} active{/if}"><i class="fa fa-sliders"></i> <a href="#" data-product="{$p.id}" class="compare-link">[`compare`]</a></span>

</div>

</div>

<div class="caption">

<div class="name"><a href="{$p.frontend_url}" {if $microsheme}itemprop="name"{/if}>{$p.name|truncate:60:"...":true}</a></div>

{if !$wa->isMobile()}<div class="description" {if $microsheme}itemprop="description"{/if} style="display: none">{if $p.summary}{strip_tags($p.summary)|escape|truncate:300}{else}{strip_tags($p.description)|escape|truncate:300}{/if}</div>{/if}

<div class="status">

<div class="rating-big">

{$rating = $wa->shop->ratingHtml($p.rating, 16)}

{if $rating}

<a href="{$p.frontend_url}#review">

{$rating}

{else}

<a href="{$p.frontend_url}#review">

<i class="icon16 star-empty"></i>

<i class="icon16 star-empty"></i>

<i class="icon16 star-empty"></i>

<i class="icon16 star-empty"></i>

<i class="icon16 star-empty"></i>

{/if} ({$p.rating_count})</a>

</div>

<div class="availability">

{if $wa->shop->settings('ignore_stock_count') || $p.count === null || $p.count > 0}

{if $p.count < 1 && $p.count !== null}

<span class="stock-none hidden-xs-down">[`Под заказ`]</span>

<span class="stock-none hidden-sm-up"><i class="fa fa-circle"></i></span>

{else}

<span class="stock-high hidden-xs-down">[`In stock`]</span>

<span class="stock-high hidden-sm-up"><i class="fa fa-circle"></i></span>

{/if}

{else}

<span class="stock-none hidden-xs-down">[`Out of stock`]</span>

<span class="stock-none hidden-sm-up"><i class="fa fa-circle"></i></span>

{/if}

</div>

</div>

{if $wa->shop->settings('ignore_stock_count') || $p.count === null || $p.count > 0}

<div class="bottom-block">

<div class="price">

{if $p.compare_price > 0}<s>{shop_currency($p.compare_price)}</s>{/if}

<span>{shop_currency($p.price)}</span>

{if $microsheme}

<meta itemprop="price" content="{$p.price}">

<meta itemprop="priceCurrency" content="{$wa->shop->primaryCurrency()}">

{/if}

</div>

<div class="add-to-cart">

<div class="text-center"><a href="#" data-url="{$wa->getUrl('shop/frontendCart/add')}" data-product_id="{$p.id}" class="btn btn-primary addtocart"></a></div>

{if $microsheme}

{/if}

</div>

</div>

{else}

<div class="bottom-block">

<div class="price">

{if $p.compare_price > 0}<s>{shop_currency($p.compare_price)}</s>{/if}

<span>{shop_currency($p.price)}</span>

{if $microsheme}

<meta itemprop="price" content="{$p.price}">

<meta itemprop="priceCurrency" content="{$wa->shop->primaryCurrency()}">

{/if}

</div>

<div class="add-to-cart">

<div class="text-center"><a href="#" class="btn btn-primary disabled"></a></div>

{if $microsheme}

{/if}

</div>

</div>

{/if}

</div>

{if method_exists(shopStorequickorderPlugin, 'product_button')}

{if $wa->shop->settings('ignore_stock_count') || $p.count === null || $p.count > 0} <div class="one-click">{else}<div class="one-click one-outstock">{/if}

{shopStorequickorderPlugin::product_button()}</div>

{/if}

{if isset($actions) == 'favorite'}<div class="after-bottom-block"><span class="active"><i class="fa fa-close"></i> <a href="#" data-product="{$p.id}" class="favorite-link">[`Remove from the list`]</a></span></div>{/if}

</div>

</form>

</div>

</div>

{/foreach}

{/strip}

Опубликовано: 13 августа 2020

    Добавить ответ

    Чтобы добавить комментарий, зарегистрируйтесь или войдите