-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dedicated integration with Product Bundles #439
Conversation
Use `->get_bundle_price( 'min' );` instead of `->get_price()` for bundles. Fixes #219 the simples way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tomalec, thanks for working on the fix for bundle pricing!
Events tracked via the classic integration all look to be using the correct values for bundle prices.
There is still an issue with the Block remove_from_cart
event. When we're building the product object in JS we're making use of product.prices.price
and when a product is removed from cart on a block powered page that value will be the base price:

We could instead rely on totals.line_total
for the price if it is available which should give us consistent pricing across different integrations.

I didn't add E2E tests, as PB is a paid extension, and public contributors to this repo would not be able to use it to run E2Es locally. We can try mocking PB interface, but then it's not really E2E. I'm open to better ideas :)
I don't have much else to suggest here I'm afraid. We could add a unit test in PHP for the bundled price in get_formatted_product
which would be a lot easier to mock although that wouldn't cover Blocks.
#439 (comment) Co-authored-by: martynmjones <[email protected]>
Thanks, @martynmjones, for catching that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @tomalec!
Pricing is consistent across different events and integrations now so LGTM ✅
WDYT of adding them as a follow-up in the next porter or cooldown cycle?
Agreed! A follow-up for adding tests sounds good.
Thanks :) Created the follow-up issue to track tests #442 |
Changes proposed in this Pull Request:
Add dedicated integration with Product Bundles,
Use
->get_bundle_price( 'min' );
instead of->get_price()
for bundles.Fixes #219 the simple way.
Checks:
Screenshots:
Detailed test instructions:
view_item
event is tracked with the correct bundle priceadd_to_cart
event is tracked with the correct bundle priceAdditional details:
Changelog entry