From 33dfd70af0a9074601838029ee042710b809e451 Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Mon, 1 Aug 2022 16:29:28 +0100 Subject: [PATCH] fix proceed to checkout button (#6804) --- src/BlockTypes/ProceedToCheckoutBlock.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/BlockTypes/ProceedToCheckoutBlock.php b/src/BlockTypes/ProceedToCheckoutBlock.php index 5f3f2171537..e2a883eeca3 100644 --- a/src/BlockTypes/ProceedToCheckoutBlock.php +++ b/src/BlockTypes/ProceedToCheckoutBlock.php @@ -11,4 +11,16 @@ class ProceedToCheckoutBlock extends AbstractInnerBlock { * @var string */ protected $block_name = 'proceed-to-checkout-block'; + + + /** + * Extra data passed through from server to client for block. + * + * @param array $attributes Any attributes that currently are available from the block. + * Note, this will be empty in the editor context when the block is + * not in the post content on editor load. + */ + protected function enqueue_data( array $attributes = [] ) { + $this->asset_data_registry->register_page_id( isset( $attributes['checkoutPageId'] ) ? $attributes['checkoutPageId'] : 0 ); + } }