{"id":50388076,"url":"https://github.com/etechflow/module-supplier-autoflow","last_synced_at":"2026-05-30T16:01:58.675Z","repository":{"id":360082533,"uuid":"1247503429","full_name":"etechflow/module-supplier-autoflow","owner":"etechflow","description":"Magento 2 module: auto-toggle supplier active flags based on stock + reprice from first-active supplier's cost × markup. Multi-supplier products, dynamic supplier-driven pricing. Pairs with ETechFlow Next Day Eligibility for synchronised next-day rules.","archived":false,"fork":false,"pushed_at":"2026-05-23T12:05:18.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T00:14:15.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://etechflow.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etechflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T12:03:15.000Z","updated_at":"2026-05-23T12:05:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/etechflow/module-supplier-autoflow","commit_stats":null,"previous_names":["etechflow/module-supplier-autoflow"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/etechflow/module-supplier-autoflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etechflow%2Fmodule-supplier-autoflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etechflow%2Fmodule-supplier-autoflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etechflow%2Fmodule-supplier-autoflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etechflow%2Fmodule-supplier-autoflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etechflow","download_url":"https://codeload.github.com/etechflow/module-supplier-autoflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etechflow%2Fmodule-supplier-autoflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33698654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T16:01:57.946Z","updated_at":"2026-05-30T16:01:58.669Z","avatar_url":"https://github.com/etechflow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ETechFlow Supplier Autoflow\n\nAuto-toggle supplier active flags based on stock, then reprice products from\nthe first-active supplier's `cost × markup`. For Magento 2 stores with\nmulti-supplier products and dynamic supplier-driven pricing.\n\n## What it does\n\nYou sell the same product through multiple suppliers in priority order:\n\n```\nS1 = Onlyda          (your manufacturer; cheap; only ships from your own stock)\nS2 = Auto Remote     (drop-ship; more expensive; ships when Onlyda is out)\nS3 = Remkeys         (drop-ship fallback)\n```\n\nThis module makes that workflow automatic:\n\n1. **Auto-toggle**: when Onlyda stock hits 0, flip S1's `active` flag off.\n   The product now fulfills from S2 = Auto Remote.\n2. **Reprice**: with S2 now first-active, recompute the customer-facing price\n   as `S2.cost × (1 + S2.markup / 100)`. Apply your configured rounding +\n   anchor strategy. Write to `price` and/or `special_price` per your output\n   target.\n3. **Audit**: every flip + reprice is logged to `etechflow_supplier_autoflow_log`\n   so finance can trace why a price changed.\n4. **NDE integration**: if you also run `etechflow/module-next-day-eligibility`,\n   the module synchronously triggers NDE's evaluator after every change.\n   `next_day_eligible` stays in sync with the active supplier — no event-bus\n   relay required.\n\n## Everything is merchant-configurable\n\nNo supplier names, no attribute codes, no markup percentages are hardcoded.\nAll configuration lives in\n`Stores → Configuration → eTechFlow → Supplier Autoflow`.\n\n### Supplier slot definition\n\nOne slot per line, in priority order (top = highest priority):\n\n```\nS1|s1_active|s1|s1_cost|s1_markup\nS2|s2_active|s2|s2_cost|s2_markup\nS3|s3_active|s3|s3_cost|s3_markup\n```\n\nFormat: `label|active_attr|name_attr|cost_attr|markup_attr[|stock_source_or_qty_attr]`.\n\n### Stock-dependent suppliers\n\nName-based, not slot-position-based. Lists which supplier *names* get the\nauto-toggle behaviour:\n\n```\nOnlyda\nOurOwnWarehouse\n```\n\nOther slots (drop-ship suppliers) stay manual-only. The merchant decides\nwhen to disable them.\n\n### Stock trigger source\n\nPick from: `magento_qty`, `msi_default`, `msi_per_slot`, `per_slot_qty_attr`,\n`disabled`. MSI modes soft-detected — module installs and works on non-MSI\nbuilds.\n\n### Price output target\n\n- `price` — write to regular price only.\n- `special_price` — write to special price only.\n- `special_price_with_anchor` (recommended) — write computed value to\n  `special_price`, write `price = special_price × anchor_multiplier`.\n  Renders strikethrough on storefront + sale-pricing on Google Shopping.\n\n### Rounding\n\n`2dp`, `5p`, `10p`, `99p_ending`, or `none`.\n\n### No-active-supplier fallback\n\nWhen every slot is inactive (all suppliers out): set product to\nout-of-stock, disable it entirely, or leave unchanged with a warning.\n\n## How it stays accurate\n\n1. **Legacy stock event observer** — `cataloginventory_stock_item_save_after`.\n2. **MSI source-items plugin** — `Magento\\InventoryApi\\Api\\SourceItemsSaveInterface`,\n   soft-detected so non-MSI installs skip it cleanly.\n3. **Product-save observer** — re-runs the pricing engine when a merchant\n   manually flips a slot's active flag or changes cost/markup.\n4. **Hourly cron** — belt-and-braces safety net for any propagation hole.\n5. **CLI** — `bin/magento etechflow:autoflow:resync [--sku=...]` for\n   manual full-catalogue evaluation.\n6. **FPC tag invalidation** — `cat_p_\u003cid\u003e` clean after every price write,\n   so customers see fresh HTML without a manual `cache:flush`.\n\n## Reverse toggle\n\nWhen stock comes back (Onlyda restocked), the previously auto-toggled slot\nflips back to active and the product reprices from THAT slot's current\ncost — handles supplier cost changes on restock.\n\nConfigurable on/off — some merchants want one-way toggles only.\n\n## Audit log\n\nEvery event writes to `etechflow_supplier_autoflow_log` with:\n\n- Product ID + SKU\n- Event type: `auto_toggle` / `reprice` / `no_active_supplier` / `error`\n- Trigger source: `stock_save` / `msi_source_items_save` / `product_save` / `cron` / `cli_resync`\n- Before/after active slot\n- Before/after price + special_price\n- Human-readable message\n\nRead via the admin grid (v0.1.1+ — coming next) or directly via SQL.\n\n## Companion modules\n\n- **`etechflow/module-next-day-eligibility`** — when installed, Autoflow's\n  active-flag changes automatically trigger NDE's eligibility recompute.\n  Recommended together for stores running dynamic next-day rules.\n\n## Versioning\n\nv0.1.0 — initial release. Engine complete; admin audit-log grid lands in\nv0.1.1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetechflow%2Fmodule-supplier-autoflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetechflow%2Fmodule-supplier-autoflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetechflow%2Fmodule-supplier-autoflow/lists"}