| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template variables: |
| 4 |
* |
| 5 |
* @var $controllers array settings as array |
| 6 |
*/ |
| 7 |
|
| 8 |
// Do not allow directly accessing this file. |
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit( 'This script cannot be accessed directly.' ); |
| 11 |
} |
| 12 |
|
| 13 |
global $product; |
| 14 |
if ( empty( $product ) ) { |
| 15 |
return; |
| 16 |
} |
| 17 |
|
| 18 |
if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : |
| 19 |
$sku = $product->get_sku() ? $product->get_sku() : esc_html__( 'N/A', 'shopbuilder' ); |
| 20 |
?> |
| 21 |
<div class="rtsb-product-sku"> |
| 22 |
<?php do_action( 'woocommerce_product_meta_start' ); ?> |
| 23 |
<span class="sku-wrapper"> |
| 24 |
<?php if ( ! empty( $controllers['show_label'] ) ) { ?> |
| 25 |
<span class="sku-label"><?php esc_html_e( 'SKU:', 'shopbuilder' ); ?></span> |
| 26 |
<?php } ?> |
| 27 |
<span class="sku-value"><?php echo esc_html( $sku ); ?></span> |
| 28 |
</span> |
| 29 |
</div> |
| 30 |
<?php |
| 31 |
endif; |
| 32 |
?> |
| 33 |
|