Incoming inventory
Showcase your different locations’ incoming inventory directly in your theme and turn interest into conversions by letting customers see if out-of-stock items are up for restocking.
This metafield is kept live updated with an array of references to your locations, complete with address information and their incoming inventory. As incoming inventory is updated or transferred, the metafield will be updated accordingly.
Details
- Name
espresso.incoming_inventory
- Description
Metafield namespace and key
- Name
list.metaobject_reference
- Description
Metafield type
- Name
variant
- Description
Scope of Shopify object that owns the metafield
Example content
[{
"location": {
"name": "Paris Warehouse",
"is_active": true,
"address": {
"address1": "123 Main Street",
"address2": "Apt. 1",
"city": "Paris",
"country": "France",
"country_code": "FR",
"formatted": "123 Main Street, Apt. 1, Paris, France, 75001",
"latitude": 48.856614,
"longitude": 2.3522229,
"phone": "(555) 555-5555",
"province": "Paris",
"province_code": "FR",
"zip": "75001",
},
},
"inventory_quantity": 20
},
{
"location": {
"name": "New York Warehouse",
"is_active": true,
"address": {
"address1": "123 Estate Street",
"address2": "Upper Floor",
"city": "New York",
"country": "United States",
"country_code": "US",
"formatted": "123 Estate Street, Upper Floor, New York, United States, NY, 10001",
"latitude": 40.7127837,
"longitude": -74.0059413,
"phone": "(555) 555-5555",
"province": "New York",
"province_code": "NY",
"zip": "10001",
},
},
"inventory_quantity": 0
}]
When you initially enable this metafield, the individual variant metafields will be set in a background task. If you have a large catalog, this may take anywhere from a few minutes to a few hours. Once the metafields are set, they will be updated in real-timetime.
Example implementation
{% assign incoming_inventory = product.selected_or_first_available_variant.metafields.espresso.incoming_inventory.values %}
{% for incoming in incoming_inventory %}
{% if incoming.location.is_active %}
<div>
<h3>{{ incoming.location.name }}</h3>
<p>{{ incoming.location.address.formatted }}</p>
<p>Incoming inventory: {{ incoming.inventory_quantity }}</p>
</div>
{% endif %}
{% endfor %}