block.json
11 months ago
button-cart.php
6 months ago
button-quick-view.php
6 months ago
controller.php
6 months ago
index-rtl.css
11 months ago
index.asset.php
1 month ago
index.css
11 months ago
index.js
1 month ago
button-cart.php
65 lines
| 1 | <div class="wp-block-buttons"> |
| 2 | <div class="wp-block-button <?php echo esc_attr( $width_class ); ?>" style="<?php echo esc_attr( $wrapper_style ); ?>"> |
| 3 | <div |
| 4 | <?php |
| 5 | echo wp_kses_data( |
| 6 | get_block_wrapper_attributes( |
| 7 | array_filter( |
| 8 | [ |
| 9 | 'role' => 'button', |
| 10 | 'tabindex' => '0', |
| 11 | 'aria-disabled' => empty( $product->in_stock ) ? 'true' : null, |
| 12 | 'disabled' => empty( $product->in_stock ) ? 'true' : null, |
| 13 | 'aria-label' => empty( $product->in_stock ) ? __( 'Sold Out', 'surecart' ) : __( 'Add to Cart', 'surecart' ), |
| 14 | 'data-wp-class--sc-button__link--busy' => 'context.busy', |
| 15 | 'style' => $style, |
| 16 | 'class' => 'wp-block-button__link sc-button__link ', |
| 17 | 'data-wp-on--click' => 'callbacks.handleSubmit', |
| 18 | 'data-wp-on--keydown' => 'callbacks.handleSubmit', |
| 19 | ], |
| 20 | function ( $value ) { |
| 21 | return null !== $value; |
| 22 | } |
| 23 | ) |
| 24 | ) |
| 25 | ); |
| 26 | ?> |
| 27 | > |
| 28 | <span class="sc-spinner" aria-hidden="true"></span> |
| 29 | |
| 30 | <?php if ( $show_icon && 'before' === $icon_position ) { ?> |
| 31 | <?php |
| 32 | echo wp_kses( |
| 33 | SureCart::svg()->get( |
| 34 | $icon, |
| 35 | [ |
| 36 | 'class' => 'wp-block-surecart-product-quick-view-button__icon sc-button__link-text', |
| 37 | ] |
| 38 | ), |
| 39 | sc_allowed_svg_html() |
| 40 | ); |
| 41 | ?> |
| 42 | <?php } ?> |
| 43 | |
| 44 | <?php if ( $show_text ) { ?> |
| 45 | <span class="sc-button__link-text"> |
| 46 | <?php echo esc_html( empty( $product->in_stock ) ? __( 'Sold Out', 'surecart' ) : $label ); ?> |
| 47 | </span> |
| 48 | <?php } ?> |
| 49 | |
| 50 | <?php if ( $show_icon && 'after' === $icon_position ) { ?> |
| 51 | <?php |
| 52 | echo wp_kses( |
| 53 | SureCart::svg()->get( |
| 54 | $icon, |
| 55 | [ |
| 56 | 'class' => 'wp-block-surecart-product-quick-view-button__icon sc-button__link-text', |
| 57 | ] |
| 58 | ), |
| 59 | sc_allowed_svg_html() |
| 60 | ); |
| 61 | ?> |
| 62 | <?php } ?> |
| 63 | </div> |
| 64 | </div> |
| 65 | </div> |