block.json
1 year ago
controller.php
1 year ago
index.asset.php
1 year ago
index.js
1 year ago
style-index-rtl.css
1 year ago
style-index.css
1 year ago
view.php
1 year ago
controller.php
20 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 | if ( empty( $price->scratch_display_amount ) ) { |
| 10 | return ''; |
| 11 | } |
| 12 | |
| 13 | $scratch_amount = $price->scratch_display_amount; |
| 14 | |
| 15 | // translators: %1$s: scratch amount. |
| 16 | $screen_reader_text = sprintf( esc_attr__( 'Scratch Price: %1$s', 'surecart' ), $scratch_amount ); |
| 17 | |
| 18 | // return the view. |
| 19 | return 'file:./view.php'; |
| 20 |