How to Use Shadow Stock and Real Stock Modes
Learn IHASHOP stock modes, shadow reporting, real stock activation, cutoff dates and safe switching.
What are stock modes?
IHASHOP Dropshipping 1.0.0 selects stock modes per supplier. Shadow reporting is default. Real mode can write shop stock during Apply. This guide follows reviewed b817b5d9. Shadow is not an exact simulation of real calculation.
Actual shadow report scope
GolgeStokRaporu and GolgeStokHesabi (version 2) use DbGolgeOkuyucu for unlocked SELECT of active variant links and core stock. S = max(0, K − T), K stored source stock, T buffer. Trash first, then unreadable core are skipped without target. Otherwise reason priority is kaynak_kayip, bloke, stok_yok, target zero. Equal target counts yazmazdi, different target yazardi. Zero-to-positive bildirim_olurdu is only a prediction.
At most 50 differing/skipped examples are reported. r_modu=R_YOK means no reservation. nm lists cakisma, pending_olurdu, atlanan_urun_tazeligi: unmeasured. Shadow service writes no table. Apply itself may modify source, snapshots and safety links; it is not read-only Preview.
Real stock calculation
StokKarari calculates real target S = max(0, K − T − R), R order reserve. Blocked variant link, missing source or null last_stock produces zero target. StokYazici locks core variant then active link and rescans orders. Ledger difference establishes expected stock. With trace, mismatch prevents write and blocks open link stock_conflict. Skipped source defers zero-to-positive opening. Without trace ilk_devralma may apply target.
Equal stock needs no physical write. Model writes can trigger aggregate stock and observers. Real mode can also generate supplier order intents; no network call in this stage.
Switch in administration
Open Marketplace > Dropshipping Suppliers (/secure/dropshipping/tedarikciler), review Stock management for the supplier. Choose enable real stock management and confirm. TedarikciYonetimi::stokGercek calls StokYazimServisi::moduDegistir. Seller gate and supplier row lock are required. Settings record stok_yazim=gercek and stok_yazim_baslangic. Success refers to next Apply, not immediate stock writes.
SenkronKosuServisi selects real or shadow only in apply. Real produces stats.stok, shadow stats.golge, never both. dry_run produces neither. golge_mod false, 0, '0', 'false' can disable shadow reporting. Shadow label alone does not guarantee a report.
Cutoff and allocations
Initial real activation sets cutoff in application timezone, Y-m-d H:i:s. Repeated activation while real preserves date. Invalid format disables real mode; format check is not full calendar validation. New sales before cutoff are not newly allocated; qualifying later cancellations/returns can enter ledger. Existing ds_order_allocations remain.
DbStokOkuyucu ledger/reserve query has no cutoff filter, so old allocations may affect reactivation. Pending and unreconciled forwarded net quantities remain reserved. UI statement about earlier orders does not mean existing allocations are erased.
Return to shadow and takeover
Return to shadow calls stokGolge. Service removes stok_yazim and stok_yazim_baslangic. Supplier links with non-null core_stock_written have core_stock_written, core_stock_written_at and ledger_net_at_write cleared; allocations and current stock remain. Sales blocks do not clear automatically. Reactivation means new cutoff and first takeover, not rollback of stock.
Supplier settings are read at run start; switching does not guarantee immediate stop of a running sync. Finish running sync before switching. Do not use mode switching to bypass stock conflict. golge_tampon is shared, integer 0–100000, default 0; no separate buffer edit action verified on this screen.
GiyimDepom and Luxstoree examples
Illustrative GiyimDepom: source 100, buffer 5, reserve 12, shop stock 80. Shadow reports 95, stock remains 80. Real target 83 may be written if checks pass. Luxstoree: source 20, buffer 3, reserve 4, shop stock 0. Shadow reports 17 and bildirim_olurdu. Real target 13; skipped source yields acilis_ertelendi and stock remains 0. Not live stocks. Real reserve is assumed present, link open and other checks pass.
GiyimDepomLuxstoree100 − 5 = 9520 − 3 = 17100 − 5 − 12 = 8320 − 3 − 4 = 1380 → 83acilis_ertelendi: 0Tests and safe checks
GolgeModTest covers R_YOK, nm, 50 examples, reason precedence, dry_run exclusion, no core write or queue, fixed error code and disable setting. StokDefteriTest covers first takeover 0→10, aggregate stock, marketplace pending and NotifyBackInStockJob, equal value, pre-cutoff sale and later cancellation, idempotent mode switching, trace reset and closed license gate. Existing tests were not rerun.
Start with Preview, then controlled shadow Apply and inspect report. Check open orders and actual stock. Enable real and verify stats.stok and storefront inventory after eligible Apply. Do not treat GOLGE_HATASI or partial writes as success.
Related guides
- How Does Dropshipping Stock Management Work?
- How to Manage Dropshipping Product Links
- How to Manage Dropshipping Sales Blocks
- How to Open Dropshipping Products for Sale
- Synchronization Preview vs Apply: What Is the Difference?
- How Does Dropshipping Product Synchronization Work?
- How to Integrate GiyimDepom Dropshipping with IHASHOP
- How to Integrate Luxstoree Dropshipping with IHASHOP
- IHASHOP Dropshipping
Frequently asked questions
Does shadow write stock?
No; calculation is read-only, but Apply can change source records.
Does shadow include reserves?
No; R_YOK is reported.
Does activation immediately write stock?
No; eligible Apply is required.
Are allocations deleted on shadow return?
No; traces clear, allocations remain.
Does switching stop a running sync?
Immediate stop is not guaranteed; finish the run first.