Get the calculated sell price for bundle products when possible

Created on 26 December 2023, 6 months ago
Updated 2 January 2024, 6 months ago

Problem/Motivation

When a product in a bundle has its price altered by some dynamic pricing rules, like for example discounts, it's not properly shown in product lists nor in the bundle add to cart form, although the rules are later applied to the price when the product is in the cart. This means that for those products the price the user sees differs from the real price they will end up paying for them.

Steps to reproduce

Create a commerce bundle group. Then create a dynamic pricing rule that affects at least one of the product variants in at least one of the bundle items, for example using the Commerce Discount module. If that is the default product variant for the bundle item, in product lists the discount won't be applied to the total price and likewise, on the bundle add to cart form, when you select that variant the discount won't be applied either.

Proposed resolution

When available, use the commerce_product_calculate_sell_price() function to get the bundle product's price. Patch attached.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain gonssal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024