Back to Documentation
Dropshipping Module

How to Manage Dropshipping Product Links

Understand IHASHOP Dropshipping product links, sales blocks, deletion safeguards and order history.

What are product links?

IHASHOP Dropshipping 1.0.0 connects source and shop products through ds_product_links and variants through ds_variant_links. Product and variant links are separate records. This guide follows reviewed b817b5d9. Link management, sales reopening and catalog deletion are distinct operations.

Origin and states

UrunYayinServisi::olustur creates a new inactive shop product and variants with origin=created. bagla links an existing unlinked shop product and selected variants with origin=matched. Existing prices, stock and content remain during initial linking. Both actions record state=active, decided_by and decided_at. sale_state=open or blocked is separate. sale_block_reason stores one reason. An active blocked link does not release its target.

VAT snapshot verification determines initial sales state.

Uniqueness and transactions

aktif_anahtar stores source ID and magaza_aktif_anahtar stores shop ID for active links. Separate unique indexes protect both fields in product and variant tables. Source row is locked FOR UPDATE; creation also uses a cache lock. Duplicate source yields ZATEN_BAGLI, unique conflict YAYIN_CAKISMASI and rollback. Nullable keys permit historical rows. No CHECK enforces state/key consistency. Direct SQL edits are unsafe.

Schema permits N:1 with nullable target key but no approved operational merge workflow was found.

Unlinking limitations

Product Publishing (/secure/dropshipping/product-publishing) lists active links. Creation, initial linking, Open sales and Take over stock are supported. No unlink, archive, transfer or relink action was found. baglaKapat only closes the selection panel. Revoking category mapping does not remove product links. archived, proposed and inactive test fixtures do not establish user features.

Missing source may receive missing_since without deleting links. Source archiving differs from link archiving. Do not manually clear keys or delete records.

Trash and restoration

Catalog soft deletion sets deleted_at; RESTRICT applies to physical deletion. CopTarayici scans open active links during successful Apply. A variant or its parent in trash or absent can trigger store_trashed. Product link checks its own shop product. Trash has priority within VAT/trash scanning; existing reasons remain. state and active keys stay unchanged. Preview only counts. Restoration does not reopen automatically.

After restoring relevant records, Open sales can remove eligible blocks. It does not write inventory or activate products. Check VAT, price and actual inventory separately.

Order history and deletion safety

All four source and shop foreign keys use RESTRICT; inactive links can also prevent physical deletion. ds_order_allocations.variant_link_id references ds_variant_links with RESTRICT. supplier_order_id references ds_supplier_orders with RESTRICT. Allocation order_id and order_item_id are plain columns without core order foreign keys. order_item_id is unique.

Allocation references remain protected but DS does not prevent physical deletion of core orders. Deducted and restored quantities feed the stock ledger. Do not delete links or purge order history as a workaround. Foreign keys alone do not guarantee complete order history preservation.

GiyimDepom and Luxstoree examples

Illustrative GiyimDepom product has created origin and two linked variants. Trashing the product may cause eligible sync to block open product and variant links with store_trashed. Restoring preserves the IDs and links; administrator reopening is required. Luxstoree product has matched origin and one order allocation. Calling bagla again to transfer it to another supplier is rejected for an active source.

An already linked shop target rejects another active link. Physical deletion of an allocated variant link is restricted. These are not live products or orders.

GiyimDepomLuxstoreeorigin=createdorigin=matchedstore_trashedds_order_allocationsstate=activeRESTRICT

Checks and tests

DsSemaKisitTest rejects duplicate active source and target links, accepts nullable historical keys and rejects deletion of referenced products. DsSemaYapiTest checks RESTRICT constraints. CopTarayiciTest checks sales-only changes, unchanged keys and row counts, and no automatic reopening. MevcutUruneBaglaTest rejects linked sources. UrunYayinTest covers atomic creation and trash reopening.

StokDefteriTest checks allocation foreign keys and order_item_id uniqueness. Existing tests were not rerun. Preserve links and order records; request a supported transfer or archive workflow.

Related guides

Frequently asked questions

Does blocking unlink a product?

No; state and active keys remain.

Is unlinking available?

No action was found in the reviewed version.

Does restoring reopen automatically?

No; eligible administrator action is required.

Can an allocated variant link be deleted?

Physical deletion is restricted by its foreign key.

Can the same shop product be linked again?

Not while its active link remains.

How Does Dropshipping Stock Management Work?

Frequently asked about this

No; state and active keys remain.