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 importproductSKUstockTotal - current importResult
10aaa-aaa-aaa10These 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 and not 0. 
bbb-bbb-bbb3
ccc-ccc-ccc2
ddd-ddd-ddd4

Scenario 2

Trigger settings:

Imported data:

stockTotal - previous importproductSKUstockTotalResult
0aaa-aaa-aaa10This meets the "Back to stock" trigger condition because the imported value - 10 - is higher than the configured "minimum stock amount" 3.
bbb-bbb-bbb3Doesn't meet the  "Back to stock" trigger condition because the imported value - 3 - is not higher than the configured "minimum stock amount 3.
ccc-ccc-ccc2Doesn'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-ddd4This meets the "Back to stock" trigger condition because the imported value - 4 - is higher than the configured "minimum stock amount" 3.