surecart
/
packages
/
blocks-next
/
build
/
blocks
/
product-quick-view-button
/
button-quick-view.php
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-quick-view.php
51 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 | [ |
| 8 | 'role' => 'button', |
| 9 | 'tabindex' => '0', |
| 10 | 'aria-disabled' => empty( $quick_view_link ) ? 'true' : null, |
| 11 | 'aria-label' => __( 'Quick Add Product', 'surecart' ), |
| 12 | 'data-wp-on--click' => 'actions.open', |
| 13 | 'data-wp-on--keydown' => 'actions.open', |
| 14 | 'data-wp-on--mouseenter' => 'actions.prefetch', |
| 15 | 'data-wp-interactive' => '{ "namespace": "surecart/product-quick-view" }', |
| 16 | 'style' => $style, |
| 17 | 'class' => 'wp-block-button__link sc-button__link ', |
| 18 | ] |
| 19 | ) |
| 20 | ); |
| 21 | ?> |
| 22 | <?php |
| 23 | echo wp_kses_data( |
| 24 | wp_interactivity_data_wp_context( |
| 25 | [ |
| 26 | 'url' => sanitize_url( $quick_view_link ), |
| 27 | ] |
| 28 | ) |
| 29 | ); |
| 30 | ?> |
| 31 | > |
| 32 | <span class="sc-spinner" aria-hidden="true"></span> |
| 33 | |
| 34 | <?php if ( $show_icon && 'before' === $icon_position ) { ?> |
| 35 | <?php echo wp_kses( SureCart::svg()->get( $icon, [ 'class' => 'wp-block-surecart-product-quick-view-button__icon sc-button__link-text' ] ), sc_allowed_svg_html() ); ?> |
| 36 | <?php } ?> |
| 37 | |
| 38 | <?php if ( $show_text ) { ?> |
| 39 | <span class="sc-button__link-text"> |
| 40 | <?php echo esc_html( empty( $product->in_stock ) ? __( 'Sold Out', 'surecart' ) : $label ); ?> |
| 41 | </span> |
| 42 | <?php } ?> |
| 43 | |
| 44 | <?php if ( $show_icon && 'after' === $icon_position ) { ?> |
| 45 | <?php echo wp_kses( SureCart::svg()->get( $icon, [ 'class' => 'wp-block-surecart-product-quick-view-button__icon sc-button__link-text' ] ), sc_allowed_svg_html() ); ?> |
| 46 | <?php } ?> |
| 47 | </div> |
| 48 | </div> |
| 49 | </div> |
| 50 | |
| 51 | <?php \SureCart::block()->quickView()->render(); ?> |