diff --git a/modules/ppcp-paylater-block/resources/js/edit.js b/modules/ppcp-paylater-block/resources/js/edit.js index 6696506e6..684e4c32e 100644 --- a/modules/ppcp-paylater-block/resources/js/edit.js +++ b/modules/ppcp-paylater-block/resources/js/edit.js @@ -14,6 +14,12 @@ export default function Edit( { attributes, clientId, setAttributes } ) { const [rendered, setRendered] = useState(false); + let amount = undefined; + const postContent = String(wp.data.select('core/editor')?.getEditedPostContent()); + if (postContent.includes('woocommerce/checkout') || postContent.includes('woocommerce/cart')) { + amount = 50.0; + } + const previewStyle = { layout, logo: { @@ -152,6 +158,7 @@ export default function Edit( { attributes, clientId, setAttributes } ) {
setRendered(true)} />