Tweak Library
Note: We have updated our folder structure in Neto 6 and this has not been updated on all tweaks yet. More info.

Only XX Left

Show "Only XX left" if the stock number is 3 or less, providing a sense of urgency to buy.

Industries

  • Bicycles
  • Computers & Electronics
  • Furniture & Homewares
  • Music & Instruments
  • Gifts
  • Toys & Games
  • Jewellery & Accessories

Wireframe

Only xxx Left

Coding Instructions

Step 1. Amend the "in stock" logic

Open up the product header template here: /assets/themes/THEME-NAME/products/includes/header.template.html

Replace the following block of code:

[%if [@store_quantity@] > 0 AND [@preorder@] %]
    <span itemprop="availability" content="preorder" class="label label-warning">Pre-order - Released [%format type:'date'%][@arrival_date@][%/format%]</span>
[%elseif [@store_quantity@] > 0 AND ![@preorder@] %]
    <span itemprop="availability" content="in_stock" class="label label-success">In Stock</span>
[%elseif [@store_quantity@] < 1 AND [@config:ALLOW_NOSTOCK_CHECKOUT@] %]
    <span itemprop="availability" content="out_of_stock" class="label label-danger">Sold Out -  Backorder Available</span>
[%else%]
    <span itemprop="availability" content="out_of_stock" class="label label-danger">Sold Out</span>
[%/if%]

With this block of code:

[%if [@store_quantity@] > 0 AND [@preorder@] %]
    <span itemprop="availability" content="preorder" class="label label-warning">Pre-order - Released [%format type:'date'%][@arrival_date@][%/format%]</span>
[%elseif [@store_quantity@] > 0 AND [@store_quantity@] <= 3 AND ![@preorder@] %]
    <span itemprop="availability" content="in_stock" class="label label-success">Only [@store_quantity@] Left!</span>
[%elseif [@store_quantity@] > 0 AND ![@preorder@] %]
    <span itemprop="availability" content="in_stock" class="label label-success">In Stock</span>
[%elseif [@store_quantity@] < 1 AND [@config:ALLOW_NOSTOCK_CHECKOUT@] %]
    <span itemprop="availability" content="out_of_stock" class="label label-danger">Sold Out -  Backorder Available</span>
[%else%]
    <span itemprop="availability" content="out_of_stock" class="label label-danger">Sold Out</span>
[%/if%]

Final Result

Brand Logo


1 related articles found: