Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Update free price display (#8241)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley authored Jan 20, 2023
1 parent c65fe1c commit 8ba1261
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { _n } from '@wordpress/i18n';
import { _n, __ } from '@wordpress/i18n';
import {
useState,
useEffect,
Expand Down Expand Up @@ -75,24 +75,31 @@ const renderPickupLocation = (
label: location
? decodeEntities( location )
: decodeEntities( option.name ),
secondaryLabel: createInterpolateElement(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
_n(
'<price/>',
'<price/> x <packageCount/> packages',
packageCount,
'woo-gutenberg-products-block'
secondaryLabel:
parseInt( priceWithTaxes, 10 ) > 0 ? (
createInterpolateElement(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
_n(
'<price/>',
'<price/> x <packageCount/> packages',
packageCount,
'woo-gutenberg-products-block'
),
{
price: (
<FormattedMonetaryAmount
currency={ getCurrencyFromPriceResponse(
option
) }
value={ priceWithTaxes }
/>
),
packageCount: <>{ packageCount }</>,
}
)
) : (
<em>{ __( 'free', 'woo-gutenberg-products-block' ) }</em>
),
{
price: (
<FormattedMonetaryAmount
currency={ getCurrencyFromPriceResponse( option ) }
value={ priceWithTaxes }
/>
),
packageCount: <>{ packageCount }</>,
}
),
description: decodeEntities( details ),
secondaryDescription: address ? (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
display: block;
}
}
.wc-block-components-radio-control__label-group {
em {
text-transform: uppercase;
font-style: inherit;
}
}
.wc-block-components-radio-control__description-group {
width: 100%;
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export const RatePrice = ( {
{ minRatePrice === maxRatePrice && ! multiple
? priceElement
: createInterpolateElement(
__( 'from <price />', 'woo-gutenberg-products-block' ),
minRatePrice === 0 && maxRatePrice === 0
? '<price />'
: __(
'from <price />',
'woo-gutenberg-products-block'
),
{
price: priceElement,
}
Expand Down

0 comments on commit 8ba1261

Please sign in to comment.