The MSI Stock Status extension will help you to display a grid of the inventory available for each one of your sources directly on your front-end product pages. The grid will also display stock status messages for your different sources.
The extension completes and expands Magento Multi Stock Inventory management and so brings more options to the default Magento 2.3 functionalities.
The stock status messages allow you to provide useful information about the availability of your products and so attract the attention of your customers. You have the possibility to create an unlimited number of messages according to conditions based on the sources, the quantities, and any product attributes.
You can create stock status messages for:
- In stock products
- Out of stock products
- Backorders
You'll also be able to deeply customize each message using placeholders as well as the PHP API which gives you an unlimited field of actions.
Terminology
- Sources
Represent physical sites where the available products are stocked and shipped from. It can be warehouses, stores, wholesalers...
See your sources from:
StoresInventorySources - Source Item
It is a source for a given product.
Assign sources to your products from the Sources tab of any product page in:
CatalogProducts - Stocks
One stock can be linked to several websites and sources.
See your stocks from:
StoresInventorySTocks - Sales Channels
Refers to a website. It can only be linked to one stock.
See your websites from:
StoresSettingsALL Stores - Salable Quantity
It is the total virtual inventory that can be sold from a website.
Check the salable quantity from:
CatalogProducts - Reservations
It is the number of products reserved and deducted from the salable quantity when customers add products to cart and pass their order.
Check the quantities reserved from:
CatalogProducts
When an order is shipped, the quantity of reservations is reset and deducted from the quantities of the inventories of the appropriate sources.
Adopt the best way to manage your inventory with the MSI Suite
The MSI Suite includes several extensions. Each one responds to a problem and to a desire to improve Magento 2 default inventory management.
Thanks to these extensions that are completely plug and play, the MSI Suite easily adapts to your business model, whether you manage several warehouses, multi-stocks, dropshipping…
Perfect your inventory management and your selling process with the MSI Suite and enjoy:
- optimal order management: optimize and automate the orders assignation to the appropriate sources. Save time and avoid human errors in your Magento 2 back office with MSI Order Management (available soon).
- smoother and fine-tuned inventory management: gain considerable time while managing your inventory directly from the stocks grid and get a clear and accurate view of your products' availability thanks to the tree view with MSI Stock Management and MSI Backorders.
- team management under control: limit the access to your orders, products, and stock management for each source by assigning specific permissions to each user registered in your Magento 2 admin with MSI Permissions.
- more transparent information on product availability: provide your customers with more information on your products' availability, carriers, or delivery times via completely customizable stock status messages with MSI Stock Status and MSI Custom Attributes.
How to use MSI Stock Status for Magento 2
You can start with configuring the front-end display of the MSI Stock Status extension from:
StoresSettingsConfigurationWyomindMSI Stock Status
Configure MSI Stock Status front-end display
MSI Stock Status gives you the possibility to display a stock grid on your front-end product pages as well as stock status messages in different places.
Configure the front-end display from:
StoresSettingsConfigurationWyomindMSI Stock StatusFront-end display
Stock status conditions
MSI Stock Status allows you to configure the stock status messages at different levels and according to your conditions.
From the Stock status conditions section, you will be able to:
- Define an additional condition by clicking on the Add a condition button.
- Delete a condition from the Action column.
Your conditions will be based on:
- Sources
Select one or more sources for that condition.
Select all sources to apply a global stock status message or create a condition for each source to display specific stock status messages. - Quantity
Define a range for the number of items for that condition.
Leaving empty will not apply any condition on the quantity. - Product attributes
You can select the product attributes to use for the stock status conditions.
They must be select attributes.
For example, if you have selected the color attribute, you will have the possibility to base your conditions on specific colors:
Then, define the Custom stock status message for that condition.
You can use any placeholders and/or fixed texts, as well as HTML, CSS, and PHP codes in the messages.
You can create messages for:
- In stock products
- Backorders
- Out of stock products
Custom in-stock messages
You can add a stock status message for in stock products.
For example:
{{product.quantity}} items available, order now!
Custom backorders messages
You have the possibility to add a message for backorderable products.
For example:
{{source.backordered_qty}} items on back order!
Custom out of stock messages
You can also add a stock status message for out of stock products.
For example:
Sorry, {{product.name}} is out of stock now.
Stock status display
The stock status messages can be displayed in different places.
You can use the saleable quantity for the qty placeholder to display the total saleable quantity in the product, cart, checkout and email messages.
If that option is disabled, the quantity displayed for the qty placeholder will be the quantity of the first store where the product is available.
Choose where you want the stock status messages to appear. You have the possibility to enable or disable the display of the stock status messages:
- on the product page
- on the cart page
- on the checkout
- in the order confirmation email
Product page
You'll also have the possibility to replace the default stock status on the product page.
Cart Page
Checkout
Order confirmation email
Stock grid display
MSI Stock Status allows you to add the stocks grid on the product page. You can easily enable the stock grid feature as below.
Stock grid template
Define how you want the stores to appear in the stock grid from the Store template field.
You can add your own content to the store template using simple texts, placeholders as well as HTML, CSS, and PHP codes.
For example:
<b>{{source.name}}</b>
<br>{{source.city}}, {{source.country}}</br>
You can also define if you want to Show out of stock source or not.
Stock grid tooltip
You can also display a tooltip in the stock grid of the product page.
You'll have to configure:
- Content of the tooltip
Add your content in the tooltip using any placeholders and/or fixed texts, as well as HTML, CSS and PHP codes. For example:
Check the availability for {{product.name}} in <span style="color: red;">our stores!</span>
- Size of the tooltip
Define the size of the tooltip in pixels.
By default, it is 200px. - Position of the tooltip
Define the position of the tooltip according to the mouse pointer.
By default, it is left.
Customize your messages
You have the possibility to expand and customize the stock status messages, stock grid template, and tooltip messages using :
- simple text and HTML/CSS codes
- placeholders
- additional placeholders: when using MSI Custom Attributes, MSI Backorders, Store Locator, Click & Collect
- the PHP API
Use placeholders
You can easily customize your messages using placeholders.
You will have to use the below format:
{{object.attribute_code}}
OBJECTS
In order to retrieve the value of an attribute, you need to define which object is targeted. The object can be:
- store
Retrieves the attribute value for the store. - product
Retrieves the attribute value for the product. - source
Retrieves the attribute value for the source.
You'll be able to use the above objects in:
- the stock grid template
- the stock status messages
- the content of the tooltip
STORE ATTRIBUTES
Below are the attributes you can use to retrieve information from the store.
{{store.name}}
This retrieves the name of the store.
Main Website Store
{{store.currency_code}}
This retrieves the currency of the source.
USD
{{store.currency_symbol}}
This retrieves the symbol of the currency.
$
PRODUCT ATTRIBUTES
In order to retrieve information from the product, you can use any product attributes.
Find below some examples.
{{product.sku}}
This will display the SKU of the product.
For example:
{{product.sku}} is currently out of stock!
{{product.name}}
This will display the name of the product.
For example:
{{product.name}} is in stock!
{{product.quantity}}
This will display the quantity of the product.
You can also use: {{source.quantity}}
For example:
Lucky you, we have {{product.quantity}} items left!
{{product.any_attribute}}
You can use any attributes listed in:
storesattributesproducts
For example:
At {{product.manufacturer}}, order this product now and receive it tomorrow!
SOURCE ATTRIBUTES
Below are the attributes you can use to retrieve information from the source.
{{source.name}}
This retrieves the name of the source.
{{source.source_code}}
This retrieves the code of the source.
{{source.contact_name}}
This retrieves the name of the contact for the source.
{{source.email}}
This retrieves the email address of the source.
{{source.phone}}
This retrieves the phone number of the source.
{{source.fax}}
This retrieves the fax number of the source.
{{source.country}}
This retrieves the country of the source.
{{source.state}}
This retrieves the state of the source.
{{source.city}}
This retrieves the city of the source.
{{source.street}}
This retrieves the street of the source.
{{source.postcode}}
This retrieves the postcode for the source.
Use additional placeholders
MSI Stock Status is fully compatible with other extensions from our MSI Suite. You can use the below extensions to customize the stock status messages, stock grid template and tooltip messages:
- Store Locator
Display all your stores on a Google map and create a unique page for each one of your offline stores. - Click & Collect
Let your customers collect their orders from any of your stores when checking out.
- MSI Backorders
Easily switch from a global backorders management to management at the level of your sources and arrange backorders dates and quantities. - MSI Custom Attributes
Brighten up the assignation of your products to the sources with any kind of custom fields.
Using the above extensions with MSI Stock Status, you will be able to enjoy additional attributes.
STORE LOCATOR ATTRIBUTES
In order to retrieve information from the sources when using Store Locator, you can use more placeholders.
{{source.image}}
This retrieves the image of the source.
{{source.street_2}}
This retrieves the address of the source.
{{source.days_off}}
This retrieves the days off for the source.
{{source.business_hours}}
This retrieves the opening hours of the source.
{{source.link}}
This retrieves the link to the store page.
CLICK & COLLECT ATTRIBUTES
In order to retrieve information from the sources when using Click & Collect, you can use another attribute.
{{source.fallback}}
Contains 0 or the code of the source used as a fallback when the product is not available in the main source.
For example:
<?php if ({{source.fallback}}) { return "The product will be sent from the ".{{source.fallback}}." source"; } ?>
MSI BACKORDERS ATTRIBUTES
When using MSI Backorders, you can use additional placeholders to retrieve information from the backorders.
{{source.backordered_qty}}
This will display the backordered quantity.
For example:
{{source.backordered_qty}} items coming soon!
{{source.backorders_date}}
This will display the date of return to stock.
For example:
New items coming soon: {{source.backorders_date}}
MSI CUSTOM ATTRIBUTES
If you are using MSI Custom Attributes, you can use the below format to retrieve any custom attributes that you have created.
{{source.custom_attributes}}
You can use any attributes that you have created using the MSI Custom Attributes extension from:
StoresInventoryStock Attributes
For example:
Order this item before {{source.cutoff}} and receive it tomorrow!
Use the PHP API
If you want to go further, MSI Stock Status allows you to fully customize your stock status messages by using PHP scripts in different ways.
Opening and closing tags
Every script must include the opening and closing PHP tags: <?php ?>
For example:
<?php /* Your custom script */ return 'Is in stock'; ?>
Outputting a value
Use the return instruction to output any value in your message.
For example:
<?php return 'The product is not available'; ?>
Variable $product
Use $product to retrieve any information from the product.
For example:
<?php if ($this->getStoreCode()=="en"){ return "In Stock ".$product->getQty().", ".$product->getAnyAttributeCode(); }; ?>
Example
With Click & Collect, you have the possibility to define a fallback strategy.
If the source has no stock for the product, then quantities will be decreased from the fallback sources.
If this is the case for a source, then you can define specific stock status messages.
For example:
<?php
if ($source->getFallback()) {
return 'Available in store in 2 days';
} else {
return 'Available for pickup today';
}
?>