-
Notifications
You must be signed in to change notification settings - Fork 37
[WC Blocks] Show "FREE" instead of $0.00 in order summary if shipping is free #623
Conversation
@@ -91,9 +91,12 @@ const ShippingTotal = ( { | |||
? parseInt( values.total_shipping, 10 ) + | |||
parseInt( values.total_shipping_tax, 10 ) | |||
: parseInt( values.total_shipping, 10 ); | |||
|
|||
const valueToShow = | |||
0 === shippingTotals ? <strong>Free</strong> : shippingTotals; |
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.
The styling to capitalise this is handled by CSS in WC Blocks, which is why an additional class was added to the TotalsWrapper
below.
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 @opr for the changes, I just pushed up a small commit to make sure the string is translatable but apart from that this is good to be merged :)
I'll wait for the PR to be merged into WooCommerce core first.
I had a question regarding styling... for stores running older versions of WooCommerce, do you think it's okay to just show the label as "Free" instead of "FREE" or should we include the CSS in subscriptions as well instead of relying on Woo?
Thanks!
@mattallan thanks a lot for your review and suggestions.
🤦🏼 Yeah that's my bad, thanks for catching that.
Great idea, actually, |
I feel like someone will notice the inconsistency so I;v just pushed up 9124f65 which uses @opr let me know if there will be problems with this. |
Thanks @mattallan this is great! I appreciate you using I think this is ready to go then. Should we hold off on merging this until woocommerce/woocommerce#47553 is merged? Just in case that doesn't make it into the 9.0 release for any reason? |
Great, thanks @opr! I see your PR into WooCommerce core was merged and tagged for the 9.0 milestone so we'll get this merged here as well. PS. I added a small clarification in the changelog entry to include the WC version. |
Note
This PR is a follow up to woocommerce/woocommerce#47553 please wait for that to be merged (or check that PR out) before testing this.
Description
This PR will show the text 'FREE' in bold and capital letters in the recurring totals area of the order summary on the Cart and Checkout blocks.
How to test this PR
Enable the shipping calculator on the cart page
is checked.Product impact
yes/no/tbc, add issue ref