etechflow / module-supplier-autoflow
etechflow/module-supplier-autoflow
Magento 2 module that auto-toggles supplier active flags based on stock and reprices products from the first-active supplier's cost × markup. Built for stores with multi-supplier products and dynamic supplier-driven pricing. Pairs cleanly with ETechFlow Next Day Eligibility — when a supplier flips, NDE re-evaluates next-day eligibility automatically.
ETechFlow Supplier Autoflow
Auto-toggle supplier active flags based on stock, then reprice products from
the first-active supplier's cost × markup. For Magento 2 stores with
multi-supplier products and dynamic supplier-driven pricing.
What it does
You sell the same product through multiple suppliers in priority order:
S1 = Onlyda (your manufacturer; cheap; only ships from your own stock)
S2 = Auto Remote (drop-ship; more expensive; ships when Onlyda is out)
S3 = Remkeys (drop-ship fallback)
This module makes that workflow automatic:
- Auto-toggle: when Onlyda stock hits 0, flip S1's
activeflag off.
The product now fulfills from S2 = Auto Remote. - Reprice: with S2 now first-active, recompute the customer-facing price
asS2.cost × (1 + S2.markup / 100). Apply your configured rounding +
anchor strategy. Write topriceand/orspecial_priceper your output
target. - Audit: every flip + reprice is logged to
etechflow_supplier_autoflow_log
so finance can trace why a price changed. - NDE integration: if you also run
etechflow/module-next-day-eligibility,
the module synchronously triggers NDE's evaluator after every change.
next_day_eligiblestays in sync with the active supplier — no event-bus
relay required.
Everything is merchant-configurable
No supplier names, no attribute codes, no markup percentages are hardcoded.
All configuration lives in
Stores → Configuration → eTechFlow → Supplier Autoflow.
Supplier slot definition
One slot per line, in priority order (top = highest priority):
S1|s1_active|s1|s1_cost|s1_markup
S2|s2_active|s2|s2_cost|s2_markup
S3|s3_active|s3|s3_cost|s3_markup
Format: label|active_attr|name_attr|cost_attr|markup_attr[|stock_source_or_qty_attr].
Stock-dependent suppliers
Name-based, not slot-position-based. Lists which supplier names get the
auto-toggle behaviour:
Onlyda
OurOwnWarehouse
Other slots (drop-ship suppliers) stay manual-only. The merchant decides
when to disable them.
Stock trigger source
Pick from: magento_qty, msi_default, msi_per_slot, per_slot_qty_attr,
disabled. MSI modes soft-detected — module installs and works on non-MSI
builds.
Price output target
price— write to regular price only.special_price— write to special price only.special_price_with_anchor(recommended) — write computed value to
special_price, writeprice = special_price × anchor_multiplier.
Renders strikethrough on storefront + sale-pricing on Google Shopping.
Rounding
2dp, 5p, 10p, 99p_ending, or none.
No-active-supplier fallback
When every slot is inactive (all suppliers out): set product to
out-of-stock, disable it entirely, or leave unchanged with a warning.
How it stays accurate
- Legacy stock event observer —
cataloginventory_stock_item_save_after. - MSI source-items plugin —
Magento\InventoryApi\Api\SourceItemsSaveInterface,
soft-detected so non-MSI installs skip it cleanly. - Product-save observer — re-runs the pricing engine when a merchant
manually flips a slot's active flag or changes cost/markup. - Hourly cron — belt-and-braces safety net for any propagation hole.
- CLI —
bin/magento etechflow:autoflow:resync [--sku=...]for
manual full-catalogue evaluation. - FPC tag invalidation —
cat_p_<id>clean after every price write,
so customers see fresh HTML without a manualcache:flush.
Reverse toggle
When stock comes back (Onlyda restocked), the previously auto-toggled slot
flips back to active and the product reprices from THAT slot's current
cost — handles supplier cost changes on restock.
Configurable on/off — some merchants want one-way toggles only.
Audit log
Every event writes to etechflow_supplier_autoflow_log with:
- Product ID + SKU
- Event type:
auto_toggle/reprice/no_active_supplier/error - Trigger source:
stock_save/msi_source_items_save/product_save/cron/cli_resync - Before/after active slot
- Before/after price + special_price
- Human-readable message
Read via the admin grid (v0.1.1+ — coming next) or directly via SQL.
Companion modules
etechflow/module-next-day-eligibility— when installed, Autoflow's
active-flag changes automatically trigger NDE's eligibility recompute.
Recommended together for stores running dynamic next-day rules.
Versioning
v0.1.0 — initial release. Engine complete; admin audit-log grid lands in
v0.1.1.
Changelog — ETechFlow Supplier Autoflow
All notable changes to this module. Adheres to Semantic Versioning.
[0.1.0] — 2026-05-23 — Initial release
First release of etechflow/module-supplier-autoflow. Engine complete; admin audit-log grid lands in v0.1.1.
What it does
You sell the same product through multiple suppliers in priority order:
S1 = Onlyda (manufacturer; cheap; ships from own stock)
S2 = Auto Remote (drop-ship; more expensive; ships when S1 is out)
S3 = Remkeys (drop-ship fallback)
This module makes that workflow automatic:
- Auto-toggle: when the configured "stock-dependent" supplier's stock hits 0, flip that slot's
activeflag off. Other slots (drop-ship) stay manual-only. - Reprice: with the next slot now first-active, recompute the customer-facing price as
cost × (1 + markup/100). Apply configured rounding + (optional) anchor strategy for strikethrough pricing. Write topriceand/orspecial_priceper the configured output target. - Audit: every flip + reprice writes to
etechflow_supplier_autoflow_logso finance can trace price changes. - NDE integration (when
etechflow/module-next-day-eligibilityis installed): synchronously calls NDE'sEligibilityEvaluatorafter every change sonext_day_eligiblereflects the new active supplier. Pairs cleanly with NDE v1.6.4's first-active-wins mode.
Everything is merchant-configurable
No supplier names, no attribute codes, no markup percentages are hardcoded. All configuration lives in Stores → Configuration → eTechFlow → Supplier Autoflow:
- Supplier slot definitions — pipe-separated lines, priority-ordered (top = highest)
Format:label|active_attr|name_attr|cost_attr|markup_attr[|stock_source_or_qty_attr] - Stock-dependent supplier names — case-insensitive list of slots that get auto-toggle behaviour. Other slots stay manual.
- Stock trigger source — five modes:
magento_qty/msi_default/msi_per_slot/per_slot_qty_attr/disabled. MSI modes soft-detected. - Price output target —
price/special_price/special_price_with_anchor(recommended for retail strikethrough pricing). - Anchor multiplier — for
special_price_with_anchormode. Default 1.40 (regular price renders 40% higher than special). Optional per-product attribute override. - Rounding —
2dp/5p/10p/99p_ending/none. - No-active-supplier fallback —
out_of_stock/disable_product/leave_with_warning. - Reverse toggle on restock — when stock returns, re-activate the slot and reprice from its current cost.
Architecture
Six service classes + two observers + one plugin + one cron + one CLI:
Model/Config.php— typed config reader (every knob)Model/Slot.php— immutable struct for one supplier slotModel/SlotResolver.php— first-active iteration with per-request memoizationModel/PricingEngine.php—cost × markup, rounding, output targetModel/PriceResult.php— immutable return valueModel/StockTrigger.php— 5 trigger modes (legacy / 3 MSI variants / disabled)Model/AutoToggleService.php— flips active flags on stock changeModel/RepriceService.php— walks slots → first-active → reprice → audit → notify NDEModel/NdeIntegration.php— soft-detect NDE, synchronously call evaluatorModel/AuditLogger.php— writes toetechflow_supplier_autoflow_logObserver/AutoToggleOnStockChange.php— legacycataloginventory_stock_item_save_afterhookObserver/RepriceOnProductSave.php—catalog_product_save_afterhook (manual merchant edits)Plugin/AutoToggleOnMsiSourceItemsSave.php— MSI source-items save hook (soft-detect)Cron/RecomputePrices.php— hourly safety net (15-past every hour)Console/Command/ResyncCommand.php—bin/magento etechflow:autoflow:resync [--sku=...]
Audit log table
etechflow_supplier_autoflow_log via etc/db_schema.xml:
| Column | Type | Purpose |
|---|---|---|
| log_id | int | PK |
| product_id | int | Catalog product id |
| sku | varchar(128) | SKU snapshot at time of event |
| event_type | varchar(32) | auto_toggle / reprice / no_active_supplier / error |
| trigger_source | varchar(64) | stock_save / msi_source_items_save / product_save / cron / cli_resync |
| old_active_slot, new_active_slot | varchar(64) | Slot labels before/after |
| old_price, new_price | decimal | Regular price before/after |
| old_special_price, new_special_price | decimal | Special price before/after |
| message | text | Human-readable note |
| created_at | timestamp | When |
Indexed on product_id, created_at, event_type. Admin grid for browsing the log lands in v0.1.1.
Installation
composer require etechflow/module-supplier-autoflow
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
Default Enable Supplier Autoflow = No. A fresh install does nothing until you configure your slots + flip the master enable to Yes. This is deliberate — auto-repricing without proper config could mass-overwrite product prices.
Companion modules
etechflow/module-next-day-eligibilityv1.6.4+ — soft-detected. When installed, Autoflow's supplier active-flag changes synchronously trigger NDE to recomputenext_day_eligible. Keeps shipping eligibility in sync with the supplier actually fulfilling the order.
Roadmap
- v0.1.1 — admin audit-log grid (browse + filter the log table from the admin UI)
- v0.1.2 — admin notice when slot mappings diverge from NDE's
- v0.2.0 — bulk price-change preview / dry-run before applying
- v1.0.0 — first production-stable release after a few merchant deploys
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.2.2 | stable | Fail | Magento 2.4.7-2.4.8 Details | 2026-06-22 15:13:16 |
| 1.2.1 | stable | Not tested | Not yet tested Details | 2026-06-22 13:07:08 |
| 1.2.0 | stable | Not tested | Not yet tested Details | 2026-06-22 12:00:50 |
| 1.1.0 | stable | Not tested | Not yet tested Details | 2026-06-06 14:14:58 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2026-06-04 15:07:56 |
| 0.1.0 | stable | Not tested | Not yet tested Details | 2026-05-23 12:05:09 |
Requires 10
| Package | Constraint |
|---|---|
| magento/framework | ^103.0||^104.0 |
| magento/module-backend | ^102.0||^103.0 |
| magento/module-catalog | ^104.0||^105.0 |
| magento/module-catalog-inventory | ^100.4||^101.0 |
| magento/module-config | ^101.2||^102.0 |
| magento/module-cron | ^100.4||^101.0 |
| magento/module-eav | ^102.1||^103.0 |
| magento/module-store | ^101.1||^102.0 |
| magento/module-ui | ^101.2||^102.0 |
| php | ~8.1.0||~8.2.0||~8.3.0||~8.4.0 |
Suggests 2
| Package | Reason |
|---|---|
| etechflow/module-next-day-eligibility | When installed, Autoflow's supplier active-flag changes automatically trigger NDE to recompute next_day_eligible — keeps shipping eligibility in sync with the supplier that's actually fulfilling the order. |
| magento/module-inventory-api | When MSI is enabled, Autoflow can use per-source stock as the auto-toggle trigger. Soft-detected — module installs and works without MSI. |
No QA results yet
QA pipelines haven't run for this version. Compatibility and quality results appear here once the vendor publishes a tagged release that gets ingested.
More from etechflow
View vendorDynamic 'View Other Options/Finishes/Sizes' PDP buttons driven by per-product link attributes; replaces hardcoded in-description buttons and strips the old ones at render time.
Theme-agnostic mega menu for Magento 2. Renders on Hyvä, Luma, Adobe Commerce default and custom themes via automatic runtime detection. Provides a JSON endpoint for lazy-loaded subcategory + featured-product data.
EtechFlow Store Locator — admin-managed store/branch finder for Magento 2 with a Leaflet + OpenStreetMap map and postcode proximity search (postcodes.io). Hyva and Luma compatible. No paid map API key required.
Universal Product Fitment Finder for Magento 2 — Make/Model/Year/Part filtering on any fitment domain (automotive, motorcycle, marine, RV, phone cases, watches, appliance parts, anywhere a customer asks "will this fit my X?"). Admin-configurable labels + URL prefix so the same module rebrands to any merchant domain. Includes PDP fitment badge, SEO URLs, customer garage with cross-device sync, OEM/part-number search, and admin tooltips throughout. Theme-agnostic — Hyvä, Luma, custom themes. Renamed from "module-vehicle-compat" in v2.0.0.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.