Back to Documentation
Dropshipping Module

How to Resolve Dropshipping Stock Conflicts

Learn IHASHOP Dropshipping stock conflicts, controlled takeover and safe reopening after synchronization.

What is a stock conflict?

IHASHOP Dropshipping 1.0.0 checks external stock differences using net ledger in real mode. Administrator, CRM or another integration may change stock unexpectedly. This guide follows reviewed b817b5d9. Conflict detection does not identify the external writer. Shadow mode does not measure conflicts.

Conflict detection

StokKarari calculates expected B = W − (D − D0). W is core_stock_written, D current net ledger, D0 ledger_net_at_write. Normal sales and returns enter ledger. Actual stock differing from B yields cakisma and no target write. StokYazici locks core and active link rows in a transaction and rescans allocations. Open variant becomes blocked/stock_conflict. Existing block reason remains. Product link is not changed directly.

Even with zero target, external value remains. Repeated conflict may be counted next run without a new block.

Conflicts in administration

Open Marketplace > Dropshipping Product Publishing (/secure/dropshipping/product-publishing) and select supplier. Stock changed outside DS (DS paused) and variant SKU appear. cakismalar groups active links by source product and lists stock_conflict or stock_takeover reasons. Missing SKU falls back to link ID. Take over stock requires confirmation. Pending takeover with null core_stock_written has no reopening button.

Once trace exists, Open sales appears. General opening button also depends on overall eligibility. Review stats.stok.sayilar.cakisma and bloke_edilen. Identify and stop the external writer first.

Take over stock

Take over stock calls StokYazimServisi::devral through UrunYayini::devral. Seller gate and active link row lock are required. Missing link yields BAG_YOK. core_stock_written, core_stock_written_at and ledger_net_at_write become null. Only stock_conflict becomes stock_takeover; sale_state stays blocked. Other reasons remain. Stock, prices, orders and allocations are unchanged by this action. Success message refers to next sync.

Service does not independently require conflict reason, real mode or selected supplier; any active link trace can be cleared. UI restrictions do not replace service validation. This is a development review finding; do not invoke service or SQL directly.

Safe zero-stock takeover

On next successful real Apply, blocked stock_takeover target is zero. Without trace, ilk_devralma applies. If actual stock differs, ProductVariant model writes 0 and updates product aggregate. If already zero, no physical write but trace is established. Stock and trace share link transaction. Failed or skipped links may not establish trace. Shadow and Preview do not complete real takeover.

Takeover synchronization never automatically opens sales. Verify actual zero stock and trace.

Open sales and next synchronization

UrunYayinServisi::satisiAc cannot open stock_conflict. For stock_takeover, non-null core_stock_written is the reason-specific condition. This does not reevaluate all VAT, price and source checks. Service locks active product link, opens eligible variants and counts remaining blocks. Blocked product requires all variant blocks resolved and own condition passing. Open sales writes no stock and does not activate product.

Next real sync calculates S = max(0, K − T − R); zero-to-positive requires fresh source. Freshness uses skipped external product IDs. New conflict stops writes again. Verify storefront purchasability separately.

GiyimDepom and Luxstoree examples

Illustrative GiyimDepom: reference 10, ledger difference 0, external stock 15. Conflict preserves 15. Takeover clears trace. Real sync writes 0. Administrator opens sales; if source 10, buffer 0, reserve 0, next eligible sync writes 10. Luxstoree: expected 20, external 22, existing vat_unverified. Conflict is counted but VAT reason remains; stock_conflict button does not appear. Even service takeover preserves VAT reason.

Ask authorized support to examine external writer and VAT. Do not bypass VAT block. Not live products.

GiyimDepomLuxstoree15 ≠ 1022 ≠ 20stock_conflict → stock_takeovervat_unverified15 → 0 → 1022 (cakisma)

Tests and safety limits

StokDefteriTest 224–263 covers preserving 15, repeated conflict, rejected opening, null trace after takeover, zero stock, administrator opening and subsequent 10 write. 272–290 covers VAT preservation; 167–190 strict opening for skipped source; 503–518 decision table. Tests were not rerun. Single reason storage and conflict report do not show every concurrent issue. A blocked link is not itself a storefront zero-stock write.

Actual external stock may remain positive during conflict. Verify that purchasing is actually prevented. Do not bypass protection by switching mode or manually clearing traces.

Related guides

Frequently asked questions

Does takeover change stock immediately?

No; it clears traces and needs a later real sync.

Does Open sales clear stock_conflict?

No; controlled takeover is required first.

Why zero stock after takeover?

The blocked stock_takeover link targets zero during first real write.

Is VAT block erased by conflict?

No; existing reason remains.

Is positive reopening guaranteed?

No; source, ledger and other stock checks must pass.

How Do Dropshipping Stock Freshness and Safe Reopening Work?

Frequently asked about this

No; it clears traces and needs a later real sync.