block.json
1 year ago
controller.php
1 year ago
index.asset.php
5 months ago
index.js
5 months ago
style-index-rtl.css
1 year ago
style-index.css
1 year ago
view.php
1 year ago
controller.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | $style = ''; |
| 4 | $style .= ! empty( $attributes['backgroundColor'] ) |
| 5 | ? esc_attr( safecss_filter_attr( 'background-color:' . $attributes['backgroundColor'] ) ) . ';' |
| 6 | : ''; |
| 7 | $style .= ! empty( $attributes['textColor'] ) |
| 8 | ? esc_attr( safecss_filter_attr( 'color:' . $attributes['textColor'] ) ) . ';' |
| 9 | : ''; |
| 10 | |
| 11 | $form = \SureCart::cart()->getForm(); |
| 12 | $form_mode = \SureCart::cart()->getMode(); |
| 13 | |
| 14 | // Stop if no form or mode found as for deletion. |
| 15 | if ( empty( $form->ID ) || empty( $form_mode ) ) { |
| 16 | return ''; |
| 17 | } |
| 18 | |
| 19 | // Don't render if the cart is disabled. |
| 20 | if ( ! \SureCart::cart()->isCartEnabled() ) { |
| 21 | return ''; |
| 22 | } |
| 23 | |
| 24 | $type = 'floating'; |
| 25 | |
| 26 | /** |
| 27 | * Allow filtering of the cart menu icon. |
| 28 | * |
| 29 | * @param string $icon The icon. |
| 30 | * @param string $mode The icon position. |
| 31 | */ |
| 32 | $icon = apply_filters( 'sc_cart_menu_icon', get_option( 'surecart_cart_icon', 'shopping-bag' ), $type ); |
| 33 | |
| 34 | // return the view. |
| 35 | return 'file:./view.php'; |
| 36 |