Accessory Lock — Require Main Product
Description
Highlights
About the Extension
Accessories Only Purchasable With Their Main Product
Do you sell products that only make sense alongside a specific main product — proprietary batteries, spare parts, extension modules, or bundled accessories? Accessory Lock closes this gap: customers can only purchase accessory products when the required main product is already in their cart.
Key Benefits
- Cart protection without JavaScript dependency — Validation runs server-side and cannot be bypassed by disabling JavaScript.
- Clear error messages — Customers see exactly which main product is missing, not a generic error.
- Storefront guidance — A Buy Together widget on the accessory product page leads customers directly to the right combination.
- Configure once with variant inheritance — Assign the lock to the parent product — all variants are protected automatically.
Features in Detail
Server-Side Cart Validation
Using Shopware's CartValidatorInterface, every cart update is checked to ensure all accessory products have a valid main product in the cart. If the main product is missing, the accessory is blocked and a multilingual error message is shown, naming both the accessory and the required main product(s).
The n:n relationship allows assigning multiple allowed main products to a single accessory — the cart is valid as long as any one of them is present.
Storefront: Buy Together Widget on Accessory Pages
On an accessory product's detail page, a widget automatically appears listing all compatible main products as selectable options. Customers choose which main product to buy together with the accessory — and add both to the cart in a single click.
If the main product is already in the cart, the widget shows an adapted layout indicating that the combination is complete, and the standard buy form for the accessory is shown.
Storefront: "Compatible Accessories" Section on Main Product Pages
On the main product's detail page, a product slider section automatically lists all compatible accessories. Each card includes an "Add Together to Cart" button that adds both the main product and the accessory simultaneously. The section can be disabled in the plugin settings without affecting cart validation.
Admin UI: Manage the Lock Directly on the Product
Every product detail page in the Shopware Admin gains a dedicated "Accessory Lock" tab. From there, you assign as many required main products as needed. A reverse view shows which other products require this product as their main product — giving you a complete picture of both sides of the relationship.
Variant Inheritance
The accessory lock is passed to product variants via Shopware's native DAL inheritance mechanism. Configure the lock once on the parent product — all variants are automatically protected. Individual variants can be overridden in the Admin tab if a specific variant requires a different main product than its sibling variants.
Technical Details
- Shopware compatibility: ~6.6.0
- PHP 8.2+
- No external services or API calls required
- Fully verified at PHPStan Level 8
- Storefront and Administration fully bilingual (German + English)
- All storefront texts (hints, buttons, error messages) use Shopware's native snippet system — customisable via Settings → Snippets, e.g. to replace the term "accessory" with your own terminology
Details
- Available: English, German
- Latest update: 17 March 2026
- Publication date: 26 March 2026
- Version: 1.0.0
- Category: Conversion Optimization
Resources
Reviews (0)
About the Extension Partner
momocode
Partner Status
-
Shopware
Extension Partner
Details
- Ø-Rating: 5
- Partner since: 2019
- Extensions: 6
Support
- Based in: Germany
- Speaks: German, English
- Response time: Very quickly