Back to stock
    • 1 Minute to read
    • Dark
      Light

    Back to stock

    • Dark
      Light

    Article summary

    Prerequisites

    The minimum stock amount must be configured.

    Logic

    When adding a product to the Product Catalog, the following condition is checked:

    (oldStockTotal == 0 ) && (minimumStockAmount < stockTotalFromFile)

    Here's what each component means:

    • oldStockTotal - the product stock total value saved in the Product Catalog, coming from previous product import.

    • stockTotalFromFile - the value of the new product stock total field coming from the current import.

    • minimumStockAmount - the value configured in the eCommerce trigger.

    In other words, we are asking two questions:

    1. Is the old stock total equal to zero?

    2. Is the configured minimum stock amount less than the stock total in the imported data?

    Examples

    Scenario 1

    Trigger settings:


    Imported data:

    stockTotal - previous import

    productSKU

    stockTotal - current import

    Result

    10

    aaa-aaa-aaa

    10

    These four rows don't meet the "Back to stock" trigger condition because the "stockTotal" value saved in the Product Catalog from the previous import was 10, not 0. 

    bbb-bbb-bbb

    3

    ccc-ccc-ccc

    2

    ddd-ddd-ddd

    4

    Scenario 2

    Trigger settings:

    Imported data:

    stockTotal - previous import

    productSKU

    stockTotal

    Result

    0

    aaa-aaa-aaa

    10

    This meets the "Back to stock" trigger condition because the imported value - 10 - is higher than the configured "minimum stock amount" 3.

    bbb-bbb-bbb

    3

    Doesn't meet the  "Back to stock" trigger condition because the imported value - 3 - is not higher than the configured "minimum stock amount”.

    ccc-ccc-ccc

    2

    Doesn't meet the "Back to stock" trigger condition because the imported value - 2 - is not higher than the configured "minimum stock amount" 3.

    ddd-ddd-ddd

    4

    This meets the "Back to stock" trigger condition because the imported value - 4 - is higher than the configured "minimum stock amount" 3.


    Was this article helpful?


    What's Next