magento bundled product Special prices fixed value

magento bundled product Special prices fixed value

October 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
magento bundled product Special prices fixed value

Magento: Setting Fixed Special Prices for Bundled Products

Setting special prices on bundled products in Magento typically requires using percentages rather than fixed values. However, there are ways to override this behavior and apply fixed special prices. In this post, we’ll guide you through the process, providing a developer’s perspective on the most effective approach.

Understanding the Default Behavior

By default, Magento treats special prices for bundled products as percentage discounts applied to the base price of each individual item in the bundle. This is because bundles are composed of multiple simple or virtual products with their own pricing structures.

To illustrate this:

$bundleProduct = $product->getTypeInstance(true);
$specialPrice = 15; // 15% special price

foreach ($bundleProduct->getTypeInstance()->getChildrenIds($productId) as $childId) {
    $child = $this->_getChild($childId, 'price');
}

In this example, a 15% discount would be applied to each child product (the items included in the bundle). The special price is calculated as $specialPrice / 100 of the base price for each item.

Setting Fixed Special Prices

To set fixed special prices on bundled products, you’ll need to override this default behavior. One approach is to create a custom module that alters the way Magento applies special prices during the product save process.

Here’s an outline of the steps involved:

  1. Create a new module: Follow the standard Magento module creation procedure. The etc/module.xml file should include your custom configuration.

  2. Override the bundle price calculation: In your custom module, create a plugin for the Magento\Catalog\Model\Product\Type class to override the special price calculation logic. You would essentially replace the percentage-based discount with a fixed value.

  3. Apply the fixed special price: Write code that sets the special price as a fixed value when saving a bundled product. This could be done in an observer or directly via your plugin.

Here’s a simplified example:

public function afterLoad(Product $subject)
{
    if ($subject->getTypeId() === 'bundle') {
        // Fetch the bundle items and their original prices
        foreach ($subject->getBundleItemsCollection() as $item) {
            $fixedSpecialPrice = 10; // Your fixed special price value
            $item->setSpecialPrice($fixedSpecialPrice);
        }
    }

    return $subject;
}

In this example, we’re setting a fixed special price of $_10 for every item in the bundle when the product is loaded.

Benefits and Considerations

Using this approach allows you to apply fixed special prices to bundled products without having to manually enter percentage discounts. It also ensures consistency across your store.

However, there are some things to consider:

  • Precision: Be aware of rounding issues if your fixed price doesn’t perfectly match the base price of an item in the bundle.
  • Performance: Overriding core Magento functionality can impact performance and stability, especially on larger sites. Ensure you optimize your code accordingly.
  • Maintenance: Changes to the core bundle product type may require updates to your custom module with each Magento version upgrade.

Conclusion

Setting fixed special prices for bundled products in Magento requires a bit of customization, but it’s certainly possible. By creating a custom module and overriding the price calculation logic, you can achieve this while keeping your store’s pricing rules consistent.

Remember to thoroughly test any customizations before deploying them to production environments. If you need further assistance or want to explore more advanced pricing strategies, don’t hesitate to reach out to our team at Laravel Company.

Happy coding!

Catalog Extensions Configuration Pricing

Our network