block.json
11 months ago
controller.php
1 year ago
index.asset.php
6 months ago
index.js
6 months ago
view.php
4 months ago
controller.php
18 lines
| 1 | <?php |
| 2 | $product = sc_get_product(); |
| 3 | |
| 4 | // handle the width attribute. |
| 5 | if ( ! empty( $attributes['width'] ) ) { |
| 6 | $width_class = 'has-custom-width wp-block-button__width-' . $attributes['width']; |
| 7 | } |
| 8 | |
| 9 | $styles = sc_get_block_styles(); |
| 10 | |
| 11 | $add_to_cart = $attributes['add_to_cart'] ?? true; |
| 12 | if ( ! \SureCart::cart()->isCartEnabled() ) { |
| 13 | $add_to_cart = false; |
| 14 | } |
| 15 | |
| 16 | // return the view. |
| 17 | return 'file:./view.php'; |
| 18 |