|
2 | 2 | /**
|
3 | 3 | * Single Product Meta
|
4 | 4 | *
|
5 |
| - * @see http://docs.woothemes.com/document/template-structure/ |
| 5 | + * This template can be overridden by copying it to yourtheme/woocommerce/single-product/meta.php. |
6 | 6 | *
|
7 |
| - * @author WooThemes |
| 7 | + * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | + * (the theme developer) will need to copy the new files to your theme to |
| 9 | + * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | + * happen. When this occurs the version of the template file will be bumped and |
| 11 | + * the readme will list any important changes. |
8 | 12 | *
|
9 |
| - * @version 3.0.0 |
| 13 | + * @see https://woocommerce.com/document/template-structure/ |
| 14 | + * @package WooCommerce\Templates |
| 15 | + * @version 9.7.0 |
10 | 16 | */
|
| 17 | + |
| 18 | +use Automattic\WooCommerce\Enums\ProductType; |
| 19 | + |
11 | 20 | if ( ! defined( 'ABSPATH' ) ) {
|
12 | 21 | exit; // Exit if accessed directly
|
13 | 22 | }
|
14 | 23 |
|
15 |
| -global $post, $product; |
16 |
| - |
| 24 | +global $product; |
17 | 25 | ?>
|
18 | 26 |
|
19 |
| -<?php |
20 |
| - |
21 |
| -if ( ( class_exists( 'SiteOrigin_Premium' ) ) && ( class_exists( 'SiteOrigin_Premium_Plugin_WooCommerce_Templates' ) ) ) { ?> |
22 |
| - |
23 | 27 | <div class="product_meta">
|
24 |
| - |
25 |
| - <?php do_action( 'woocommerce_product_meta_start' ); ?> |
26 |
| - |
27 |
| - <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) { ?> |
28 |
| - |
29 |
| - <span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'siteorigin-north' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'siteorigin-north' ); ?></span></span> |
30 |
| - |
31 |
| - <?php } ?> |
32 |
| - |
33 |
| - <?php echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'siteorigin-north' ) . ' ', '</span>' ); ?> |
34 |
| - |
35 |
| - <?php echo wc_get_product_tag_list( $product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', count( $product->get_tag_ids() ), 'siteorigin-north' ) . ' ', '</span>' ); ?> |
36 |
| - |
37 |
| - <?php do_action( 'woocommerce_product_meta_end' ); ?> |
38 |
| - |
39 |
| -</div> |
40 |
| - |
41 |
| -<?php } else { ?> |
42 |
| - |
43 |
| -<div class="product_meta"> |
44 |
| - |
45 |
| - <?php do_action( 'woocommerce_product_meta_start' ); ?> |
46 |
| - |
47 |
| - <?php if ( function_exists( 'wc_get_product_tag_list' ) ) { ?> |
| 28 | + <?php |
| 29 | + do_action( 'woocommerce_product_meta_start' ); |
| 30 | + |
| 31 | + if ( |
| 32 | + class_exists( 'SiteOrigin_Premium' ) && |
| 33 | + class_exists( 'SiteOrigin_Premium_Plugin_WooCommerce_Templates' ) |
| 34 | + ) { |
| 35 | + if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( ProductType::VARIABLE ) ) ) { |
| 36 | + ?> |
| 37 | + <span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'siteorigin-north' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'siteorigin-north' ); ?></span></span> |
| 38 | + <?php |
| 39 | + } |
| 40 | + |
| 41 | + echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'siteorigin-north' ) . ' ', '</span>' ); |
| 42 | + |
| 43 | + echo wc_get_product_tag_list( $product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', count( $product->get_tag_ids() ), 'siteorigin-north' ) . ' ', '</span>' ); |
| 44 | + } elseif ( function_exists( 'wc_get_product_tag_list' ) ) { ?> |
48 | 45 | <?php echo wc_get_product_tag_list( $product->get_id(), '', '<div class="tags-list">', '</div>' ); ?>
|
49 |
| - <?php } ?> |
50 |
| - |
51 |
| - <?php do_action( 'woocommerce_product_meta_end' ); ?> |
52 |
| - |
| 46 | + <?php |
| 47 | + } |
| 48 | + |
| 49 | + do_action( 'woocommerce_product_meta_end' ); |
| 50 | + ?> |
53 | 51 | </div>
|
54 |
| - |
55 |
| -<?php } ?> |
0 commit comments