Virtual bundles
Some ShopWired retailers create multi-product offers where customers select variations for several products and add them all to the basket in a single action. This is useful when selling sets, kits, or grouped items that include products with variations. The standard product bundles feature cannot include products with variations, so an alternative structure is required.
A virtual bundle is created using theme-level custom code. It presents a single entry product on the website but adds multiple constituent products to the basket in the background. Each constituent product behaves like a normal product, including full variation selection and stock tracking.
This feature is not part of the standard ShopWired product options system or product bundles. It is created using custom fields and theme code, and can be implemented by a developer familiar with JavaScript, Twig, and ShopWired’s theme structure.
How the feature works
A virtual bundle is built around a standard product that represents the bundle on the website. This product is referred to as the entry product. It appears in categories, search results, and product feeds in the same way as any other product.
Virtual bundle behaviour is controlled using custom fields added to the entry product. Each custom field stores the product that should be included in the bundle. The virtual bundle page reads these custom fields and displays each constituent product beneath the entry product.
For each constituent product, the virtual bundle page can display:
- The product name
- Product variation selectors (buttons or dropdowns)
- Price information (the standard product price)
- Any custom user interface added as part of the implementation
The visitor selects variations for each item and enters the required quantities. When the visitor selects the add to basket button, the virtual bundle code adds each constituent product to the basket individually using the standard add-to-basket process.
This structure ensures that variation data, stock levels, and pricing behave exactly as they do for normal products.
Variations
Virtual bundles support constituent products that have variations. The visitor selects variations using the standard variation interface from each product, such as:
- Buttons
- Dropdown menus
Every variation configured on the constituent product can be selected. This applies to all products included in the virtual bundle.
Variation stock is checked in real time. The page can be configured to display variation-specific stock, prices, or other attributes where required.
Pricing behaviour
A virtual bundle does not use the standard product bundles pricing system. Instead, pricing is controlled using one of two methods.
Method 1: Offers (recommended)
The offers feature is the preferred method for setting virtual bundle pricing.
Create an offer that applies when all constituent products are present in the basket. The offer can:
- Apply a fixed price to the combined items
- Apply a percentage discount
- Apply a fixed discount
Offers ensure that the correct bundle price is applied and that prices remain consistent across the website.
Method 2: Theme-level custom pricing
Alternatively, the theme can override product prices in JavaScript before the items are added to the basket. This sets custom prices for each constituent product at the moment they are added.
This method is suitable for simple fixed-price bundles, but offers provide greater reliability, flexibility, and control.
Stock tracking
Virtual bundles rely on normal product and variation stock behaviour.
To track stock accurately you must ensure that each constituent product assigned to the virtual bundle product has a SKU code.
When an order is placed, stock is reduced for each constituent product based on the variation and quantity selected. The entry product itself is not added to the order and has no impact on stock.
If a constituent product uses the stock on back order feature, the virtual bundle will respect that configuration.
Example use cases
Virtual bundles can be useful when:
- You want to create a bundle containing products with variations
- You want customers to choose their own variation combinations
- You want to display all constituent items on a single page
- You need accurate per-product stock reduction
- You want to apply a fixed or discounted price to a multi-product set
- The standard product bundles feature does not meet your requirements
Implementing virtual bundles
Implementation requires theme-level code changes. A typical build includes:
- A check for custom fields on the entry product
- Code to display constituent products and variation selectors
- JavaScript to add all items to the basket together
- Optional price override logic
- Optional offer display and validation
- Error handling for missing variation selections
The exact implementation will depend on your requirements.
Contact theme support for assistance.