Fix product list price help label to properly reflect tax settings (#34564)

* Fix product list price tax included help label

* Add changelog entry for products list price help label.
This commit is contained in:
Matt Sherman 2022-09-07 09:33:12 -04:00 committed by GitHub
parent 966cff5e7a
commit beb6a6f4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 9 deletions

View File

@ -63,16 +63,19 @@ export const PricingSection: React.FC = () => {
return cleanValue;
};
const taxSettingsText =
'Per your {{link}}store settings{{/link}}, tax is {{strong}}%sincluded{{/strong}} in the price.';
const addNot = pricesIncludeTax ? '' : 'not ';
taxSettingsText.replace( taxSettingsText, addNot );
const taxIncludedInPriceText = __(
'Per your {{link}}store settings{{/link}}, tax is {{strong}}included{{/strong}} in the price.',
'woocommerce'
);
const taxNotIncludedInPriceText = __(
'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.',
'woocommerce'
);
const taxSettingsElement = interpolateComponents( {
mixedString: __(
'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.',
'woocommerce'
),
mixedString: pricesIncludeTax
? taxIncludedInPriceText
: taxNotIncludedInPriceText,
components: {
link: (
<Link
@ -80,7 +83,9 @@ export const PricingSection: React.FC = () => {
target="_blank"
type="external"
onClick={ () => {
recordEvent( 'product_pricing_list_price_help' );
recordEvent(
'product_pricing_list_price_help_tax_settings_click'
);
} }
>
<></>

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix product list price help label to properly reflect tax settings.