surecart
/
packages
/
blocks-next
/
build
/
blocks
/
product-selected-variant-image
/
controller.php
surecart
/
packages
/
blocks-next
/
build
/
blocks
/
product-selected-variant-image
Last commit date
block.json
11 months ago
controller.php
11 months ago
index.asset.php
1 week ago
index.js
1 week ago
style-index-rtl.css
11 months ago
style-index.css
11 months ago
view.php
1 year ago
controller.php
25 lines
| 1 | <?php |
| 2 | $product = sc_get_product(); |
| 3 | |
| 4 | // make sure we have the product and variants. |
| 5 | if ( empty( $product ) ) { |
| 6 | return null; |
| 7 | } |
| 8 | |
| 9 | $class = 'align-left '; // For theme compatibility. |
| 10 | $class .= $attributes['sizing'] ? ( 'contain' === $attributes['sizing'] ? 'sc-is-contained' : 'sc-is-covered' ) : 'sc-is-covered'; |
| 11 | $class .= $attributes['hide_on_mobile'] ? ' hide-on-mobile' : ''; |
| 12 | |
| 13 | $style = ''; |
| 14 | $style .= ! empty( $attributes['aspectRatio'] ) |
| 15 | ? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';' |
| 16 | : ''; |
| 17 | $style .= ! empty( $attributes['width'] ) |
| 18 | ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';' |
| 19 | : ''; |
| 20 | $style .= ! empty( $attributes['height'] ) |
| 21 | ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';' |
| 22 | : ''; |
| 23 | |
| 24 | return 'file:./view.php'; |
| 25 |