Is there any way to support a base price for the cart transform merge operation?

Some users want to offer a base price for a bundle to cover the packing cost or a premium. However, the merge operation can only add the prices of the bundle components.

For example, the base price is $5. The customers can add any 5 variants to get a 10% off. The bundle price is $5 + (total variant prices x 90%) or ($5 + total variants prices) x 90%. I can apply a percentage decrease to the merge operation: MergeOperation

I believe the expand operation is not useful since the bundle parent price is used. But I don’t know the bundle parent price. It’s dynamic

In the merge operation, only a percentageDecrease can be supported. Can Shopify support a fixed amount increase or a percentage increase?

A user sells cookie boxes (e.g. cookie box of 3 or 6) and he wants to bump up the bundle price by $1 to cover the bundle box fee.

Hey @Benny_Chan :waving_hand:, you’re on point here, right now for Cart Transform Functions specifically, we do only support percentage decrease price adjustments.

One workaround I can think of would be to have a capped price for the parent bundle which you could then programmatically decrease to the desired amount. For example, set the parent bundle to $100, then calculate the percentage decrease needed to reach your target price (base + components). So for a $1 box fee + $24 of cookies, you’d decrease by 75% to get $25 total.

It’s definitely not the most ideal workaround though (and you’ll want to consider how the original price displays), so I’m happy to put through a feature request for you on my end. Fixed amount increases and percentage increases for merge operations would definitely make bundle pricing more flexible.

If you’d like to share any other specific use cases just let me know and I can pass your feedback on to our team here. :slight_smile:

The bundle price of the merge operation relies on the bundle components, but not the bundle parent. Therefore, I can’t set the parent bundle price.

Your case may be working for the expand operation. The bundle price relies on the bundle parent for expand. However, if the user can set a specific price for the bundle. There is no need to set up a base price because the bundle fixed price can include this extra packing cost.

Thanks for the follow-up and clarification @Benny_Chan! You’re correct here - merge operations work with component prices, not the parent bundle price. I had been thinking about fixed product bundles as a potential workaround in my earlier response, but that may not fit your use case, so I definitely understand where you’re coming from

Unfortunately, adding fixed amount increases to merge operations isn’t something we currently support. For now, the best recommendation would be including the base fee in your component prices as the most straightforward approach (but I do understand if this isn’t feasible because of the dynamic pricing).

Let me touch base with the team internally to confirm there aren’t any other workarounds I’m missing, and I’ll loop back with you on this thread. I’ll also make sure your use case is captured in the feature request I’ll set up for more flexible bundle pricing options.

Hey @Benny_Chan :waving_hand: - just following up to let you know that I’ve spoken with the product team on this and they’ve let me know that we are hoping to improve and add features to cart transforms and have logged your feedback on this.

Out of curiosity as well, have you tried adding negative values in the percentageDecrease input? Just wanted to suggest that as a possible workaround if that works for you.

No, I didn’t try this hack since Shopify doesn’t allow negative discounts. I’ll take a look and get back to you later. Thanks for following up.

1 Like

@Alan_G

Almost feasible, but I still have a question:

I can calculate the percentage decrease = base price / sum of all subtotalAmount of the selected variants * -1. I try to bump up the the bundle price and it’s increased as expected. But I don’t know how to handle multi-currency.

Let’s say the user sets a base price of $10 with the store currency, e.g CAD. In the Shopify function, how can I exchange it to another currency like USD? Or I have to handle currency conversion in the frontend?

Hey @Benny_Chan :waving_hand: - great question.

You should be able to use input.presentmentCurrencyRate in your Cart Transform function to handle the conversion (More info here).

For example, for CAD, you could just multiply your base price (10 CAD) by this rate to get the amount in the customer’s currency, then use that converted value in your negative percentage calculation. So if the rate is 0.75 for CAD to USD, you’d calculate: convertedBase = 10 * 0.75 = 7.50 USD , then percentageDecrease = (7.50 / sumOfVariantPrices) * -1 . This way all the currency logic stays in the function and you don’t need any frontend conversion. Let me know if it works for your use case or if I can help out any further!

Thanks, this formula works! I’ve deloyed an update. We’ll see if the users have any issues with the calculated bundle price. :folded_hands:

1 Like

No worries @Benny_Chan, glad to hear that it’s working for you! Let me know if we can help out further on our end here :slight_smile: