Skip to content

Commit

Permalink
feat: WooPay button SSR (#7463)
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso authored Oct 16, 2023
1 parent 058036b commit 8c50941
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/images/woopay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions changelog/feat-woopay-button-pre-render
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

feat: add WooPay button SSR
15 changes: 13 additions & 2 deletions includes/class-wc-payments-woopay-button-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,21 @@ public function display_woopay_button_html() {
return;
}

$settings = $this->get_button_settings();

?>
<div id="wcpay-woopay-button" data-product_page=<?php echo esc_attr( $this->is_product() ); ?>>
<?php // The WooPay express checkout button React component will go here. ?>
</div>
<?php // The WooPay express checkout button React component will go here. This is rendered as disabled for now, until the page is initialized. ?>
<button
class="woopay-express-button"
aria-label="<?php esc_attr_e( 'WooPay', 'woocommerce-payments' ); ?>"
data-type="<?php echo esc_attr( $settings['type'] ); ?>"
data-theme="<?php echo esc_attr( $settings['theme'] ); ?>"
data-size="<?php echo esc_attr( $settings['size'] ); ?>"
style="height: <?php echo esc_attr( $settings['height'] ); ?>px"
disabled
></button>
</div>
<?php
}

Expand Down

0 comments on commit 8c50941

Please sign in to comment.