P
P
pokanub2021-09-21 16:38:41
Online shopping
pokanub, 2021-09-21 16:38:41

How to make goods on order on Webasyst?

How to make all products that have 777,777 items on the site display "on order" instead of "in stock"
Function product.cart.html

{function name=in_stock n=0 low=5 critical=2}

        {if $n > $low or $n === null}
                <div class="stock-info stock">
                        <svg class="icon" width="10" height="7">
                                <use xlink:href="#icon-tick"></use>
                        </svg>
                        <div class="stock-info__text">[`In stock`]</div>
                </div>
        {elseif $n > $critical}
                <div class="stock-info less-stock">
                        <svg class="icon" width="10" height="7">
                                <use xlink:href="#icon-tick"></use>
                        </svg>
                        <div class="stock-info__text">{_w("Only a few items left")}</div>
                </div>
        {elseif $n > 0 && $n != 1}
                <div class="stock-info less-stock">
                        <svg class="icon" width="10" height="7">
                                <use xlink:href="#icon-tick"></use>
                        </svg>
                        <div class="stock-info__text">{_w("Only %d left in stock", "Only %d left in stock", $n)}</div>
                </div>
        {elseif $n == 1}
                <div class="stock-info single-stock">
                        <div class="stock-info__text">{_w("Only %d left in stock", "Only %d left in stock", $n)}</div>
                </div>
        {else}
                <div class="stock-info no-stock">
                        <div class="stock-info__text"></div>
                </div>
        {/if}
{/function}

product.html

{if $theme_settings.shop_productpage_view eq 2}</div>{/if}
                  {if $theme_settings.shop_productpage_view ne 2}
                    <div class="mb-hide s-product-stocks">
                      {foreach $product.skus as $sku}
                        {if $sku.stock}
                          {foreach $stocks as $stock_id => $stock}
                            <div class="pd-descr__stock s-product-stock sku-{$sku.id}-stock"{if $sku.id != $product.sku_id} style="display:none"{/if} data-sku-count="{$sku.count}">
                              {if isset($sku.stock[$stock_id])}
                                {$stock_count = $sku.stock[$stock_id]}
                              {else}
                                {$stock_count = null}
                              {/if}
                              <div class="pd-descr__stock-title">{$stock.name|escape}</div>
                              {in_stock n=$stock_count low=$stock.low_count critical=$stock.critical_count}
                            </div>
                          {/foreach}
                        {else}
                          <div class="pd-descr__stock s-product-stock sku-{$sku.id}-stock"{if $sku.id != $product.sku_id} style="display:none"{/if} data-sku-count="{$sku.count}">
                            {in_stock n=$sku.count}
                          </div>
                        {/if}
                      {/foreach}
                    </div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question