mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
First attempt at fixing the PayLater Messaging block on the frontend. The block renders but with default config and not block specific settings.
This commit is contained in:
parent
6139f071e5
commit
d30b44d18e
6 changed files with 34 additions and 15 deletions
|
@ -48,5 +48,6 @@
|
|||
},
|
||||
"textdomain": "woocommerce-paypal-payments",
|
||||
"editorScript": "ppcp-paylater-block",
|
||||
"editorStyle": "file:./assets/css/edit.css"
|
||||
"editorStyle": "file:./assets/css/edit.css",
|
||||
"render": "file:./src/PayLaterBlockRender.php"
|
||||
}
|
||||
|
|
|
@ -18,7 +18,9 @@ const blockId = 'woocommerce-paypal-payments/paylater-messages';
|
|||
registerBlockType( blockId, {
|
||||
icon: paypalIcon,
|
||||
edit: Edit,
|
||||
save,
|
||||
save() {
|
||||
return null;
|
||||
},
|
||||
} );
|
||||
|
||||
document.addEventListener( 'DOMContentLoaded', () => {
|
||||
|
|
|
@ -22,5 +22,7 @@ export default function save( { attributes } ) {
|
|||
...paypalAttributes,
|
||||
};
|
||||
|
||||
return <div { ...useBlockProps.save(props) }></div>;
|
||||
return <div {...useBlockProps.save(props)}>
|
||||
<div id="ppcp-messages" data-partner-attribution-id="Woo_PPCP"></div>
|
||||
</div>;
|
||||
}
|
||||
|
|
17
modules/ppcp-paylater-block/src/PayLaterBlockRender.php
Normal file
17
modules/ppcp-paylater-block/src/PayLaterBlockRender.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* The Pay Later block render callback.
|
||||
*
|
||||
* @package WooCommerce\PayPalCommerce\PayLaterBlock
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\PayLaterBlock;
|
||||
|
||||
$attributes = get_block_wrapper_attributes()
|
||||
?>
|
||||
<div id="ppcp-paylater-message-block" <?php echo $attributes; ?>>
|
||||
<?php echo do_action('ppcp-paylater-message-block', $attributes); ?>
|
||||
</div>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue