Не выводится надпись что товара нет в наличии

Добрый день!

Может кто подскажет, двое суток пытаюсь исправить, чтобы выводилась информация, что товара нет в наличии, но ничего не выходит. Тема дизайна Ahead. Код ниже:

{strip}
{* VARIABLES *}
{$_extra_classes = []}
{if !empty($params['classes'])}
{$_extra_classes[] = $params['classes']}
{/if}
{if $product_available || count($product.skus) > 1}
<div class="s-stocks-wrapper {$_extra_classes|join:" "}">
<div class="sku-no-stock" style="display: none;">
<div class="stock-critical font-size-xs font-weight-bold text-muted">[`Out of stock`]</div>
</div>
<div class="sku-not-available" style="display: none;">
<div class="stock-critical font-size-xs font-weight-bold text-muted">[`Product with the selected option combination is not available for purchase`]</div>
</div>
{function name=stock_html icon="" icon_class="" stock_class="" stock_text=""}
<span class="badge badge-sm badge-rounded-circle {$icon_class} mr-2">
<i class="icon">{call include_icon icon="{$icon}"}</i>
</span>
<span class="{$stock_class}">{$stock_text}</span>
{/function}
{function name=in_stock n=0 low=5 critical=2}
{$unit_name = ''}
{if !empty($formatted_units[$product["stock_unit_id"]]) && $_frac_enabled === true}
{$unit_name = $formatted_units[$product["stock_unit_id"]]["name_short"]}
{/if}
{$left_text = _w("%s left", "%s left", $n)}
{if $n > $low or $n === null}
{stock_html icon="feather/check" icon_class="badge-success" stock_class="s-product-stock__in-stock" stock_text=$theme_settings.product_list__stocks_instock}
{elseif $n > $critical}
{stock_html icon="feather/check" icon_class="badge-warning" stock_class="s-product-stock__pre-order" stock_text="{$left_text} {$unit_name}"}
{elseif $n > 0}
{stock_html icon="feather/check" icon_class="badge-danger" stock_class="s-product-stock__pre-order" stock_text="{$left_text} {$unit_name}"}
{else}
{if $wa->shop->settings('ignore_stock_count')}
{stock_html icon="feather/check" icon_class="badge-warning" stock_class="s-product-stock__pre-order" stock_text="{$theme_settings.product_list__stocks_preorder}"}
{else}
{stock_html icon="feather/x" icon_class="badge-danger" stock_class="s-product-stock__out-of-stock" stock_text="{$theme_settings.product_list__stocks_outofstock}"}
{/if}
{/if}
{/function}
{foreach $product.skus as $sku}
<div class="sku-{$sku.id}-stock" {if $sku.id != $product.sku_id}style="display:block"{/if} data-sku-count="{$sku.count}">
<div class="d-flex align-items-center flex-wrap font-size-xs">
{if $sku.available}
{if !$wa->shop->settings('ignore_stock_count') && $sku.count !== null && ($sku.count == 0 || !empty($sku["order_count_min"]) && $sku.count > 0 && $sku["order_count_min"] > $sku.count)}
<div class="sku-no-stock">
<strong class="stock-critical">[`Out of stock`]</strong>
</div>
{$_is_out_of_stock = true}
{else}
{if $sku.stock}
{foreach $stocks as $stock_id => $stock}
{if isset($sku.stock[$stock_id])}
{$stock_count = $sku.stock[$stock_id]}
{else}
{$stock_count = null}
{/if}
<div class="s-stock-item d-flex align-items-center">
<span class="s-label text-muted mr-2">{$stock.name|escape}:</span>
{in_stock n=$stock_count low=$stock.low_count critical=$stock.critical_count}
</div>
{/foreach}
{else}
{in_stock n=$sku.count}
{/if}
{/if}
{else}
<div class="sku-not-available">
<strong class="stock-none">[`Product with the selected option combination is not available for purchase`]</strong>
</div>
{/if}
</div>
</div>
{/foreach}
</div>
{/if}
{/strip}

1 ответ

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

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