warehouse_qty

Loads the quantity of a product based on the warehouse ID param

Example

[%warehouse_qty id:'[@sku@]'%]
    [%param *header%]
        <h4>Warehouse QTY</h4>
    [%/param%]
    [%param *body%]
        [@warehouse_quantity@]
    [%/param%]
    [%param *footer%]
    [%/param%]
[%/warehouse_qty%]

Usage

The warehouse_qty tag queries quantity results in multiple warehouses based on the SKU parameter so you can print a data tag to show the results specific to that warehouse or print other data specific to that warehouse.

Important note : The warehouse_qty function will only show warehouses that have been set to Visible to customer in the Maropost Commerce Cloud control panel and which have a positive stock value for the SKU specified.

Need to return a reference to an out of stock warehouse?

The *ifempty code block will only trigger if the SKU specified in the id param is completely out of stock. To return empty warehouses while some still have stock you can loop through a static list of the Warehouse Names or IDs, then run through the available warehouses, comparing the static list name to the warehouse_qty name (or ID if using that instead).

If the static warehouse value doesn't match any of the dynamic values returned you can assume that warehouse has no stock and display a message indicating as such:

[%split delimiter:','%]
    [%param data1%]Warehouse 1,Brisbane Warehouse,Melbourne Warehouse[%/param%]
    [%param *header%]
        <h4>Warehouse QTY</h4>
    [%/param%]
    [%param *body%]
        [%set [@empty_warehouse@]%]1[%/set%]
        [%warehouse_qty id:'[@sku@]'%]
            [%param *body%]
                [%if [@warehouse_name@] eq [@data1@] %]
                    [%set [@^empty_warehouse@]%]0[%/set%]
                    <p>[@warehouse_name@] = [@warehouse_quantity@] in stock</p>
                [%/if%]
            [%/param%]
        [%/warehouse_qty%]
        [%if [@empty_warehouse@] %]
            <p>[@data1@] = 0 in stock</p>
        [%/if%]
    [%/param%]
[%/split%]

Parameters

Name Options Description
id:'' Product SKU Specifies the SKU to query for the warehouse data
limit:'' Integer Limits the body results based on value
*header HTML & b@se tags Renders a single usable space above the body
*body HTML & b@se tags Runs an array for result
*footer HTML & b@se tags Renders a single usable space below the body
*ifempty:'' HTML & b@se tags If the warehouse_qty returns no results, load this code block instead

Data Tags

Data tag Product Field Example Description
`[@committed_quantity@]` Qty Committed 13 The quantity in stock that is committed of the queried warehouse
`[@component_quantity@]` Qty Kitted 0 The component quantity if relevant
`[@count@]` 0 A count that runs for each body parameter run
`[@location@]` Warehouse Qty / Pick Zone Stock: 59
A25
The stock/location of the item
`[@pick_zone@]` Pick Zone A25 The pick zone where the item is located
`[@warehouse_id@]` 5 The ID of the warehouse
`[@warehouse_name@]` Warehouse Gold Coast The warehouse name
`[@warehouse_qty@]` Qty On Hand 46 Quantity on hand (Warehouse Qty minus Qty Committed)
`[@warehouse_quantity@]` Warehouse Qty 59 The quantity in stock of the queried warehouse
`[@warehouse_ref@]` GC The warehouse location reference

Was this article useful?

Be notified when this page is updated. Optional.