Merge pull request #1874 from woocommerce/PCP-2380-ui-fixes

Change default "Place Order" button text, add additional "Place Order" description in block
This commit is contained in:
Emili Castells 2023-11-30 09:36:03 +01:00 committed by GitHub
commit 8ab5ec93ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 29 deletions

View file

@ -326,11 +326,19 @@ const PayPalComponent = ({
const features = ['products'];
if ((config.addPlaceOrderMethod || config.usePlaceOrder) && !config.scriptData.continuation) {
let descriptionElement = <div dangerouslySetInnerHTML={{__html: config.description}}></div>;
if (config.placeOrderButtonDescription) {
descriptionElement = <div>
<p dangerouslySetInnerHTML={{__html: config.description}}></p>
<p style={{textAlign: 'center'}} className={'ppcp-place-order-description'} dangerouslySetInnerHTML={{__html: config.placeOrderButtonDescription}}></p>
</div>;
}
registerPaymentMethod({
name: config.id,
label: <div dangerouslySetInnerHTML={{__html: config.title}}/>,
content: <div dangerouslySetInnerHTML={{__html: config.description}}/>,
edit: <div dangerouslySetInnerHTML={{__html: config.description}}/>,
content: descriptionElement,
edit: descriptionElement,
placeOrderButtonLabel: config.placeOrderButtonText,
ariaLabel: config.title,
canMakePayment: () => config.enabled,