block.json
1 year ago
controller.php
1 year ago
index.asset.php
1 year ago
index.js
1 year ago
view.php
1 year ago
controller.php
21 lines
| 1 | <?php |
| 2 | // no price in the context. |
| 3 | $price = $block->context['price'] ?? ''; |
| 4 | |
| 5 | if ( empty( $price ) || is_wp_error( $price ) ) { |
| 6 | return ''; |
| 7 | } |
| 8 | |
| 9 | // get the display amount. |
| 10 | // translators: %1$s: amount. |
| 11 | $display_amount = $price->display_amount; |
| 12 | |
| 13 | // translators: %1$s: amount. |
| 14 | $screen_reader_text = sprintf( esc_attr__( 'Price: %1$s', 'surecart' ), $display_amount ); |
| 15 | if ( ! empty( $price->payments_text ) ) { |
| 16 | $screen_reader_text .= ' ' . $price->payments_text; |
| 17 | } |
| 18 | |
| 19 | // return the view. |
| 20 | return 'file:./view.php'; |
| 21 |