diff --git a/templates/single-product/add-to-cart/external.php b/templates/single-product/add-to-cart/external.php index 1636c3a2c81e9..12fc0c382b6c0 100644 --- a/templates/single-product/add-to-cart/external.php +++ b/templates/single-product/add-to-cart/external.php @@ -7,7 +7,10 @@ * @version 2.1.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} + ?> @@ -16,4 +19,4 @@

- \ No newline at end of file + diff --git a/templates/single-product/add-to-cart/grouped.php b/templates/single-product/add-to-cart/grouped.php index f62b1e63fd56e..963d223aaa91a 100644 --- a/templates/single-product/add-to-cart/grouped.php +++ b/templates/single-product/add-to-cart/grouped.php @@ -7,7 +7,9 @@ * @version 2.1.7 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $product, $post; @@ -79,4 +81,4 @@ - \ No newline at end of file + diff --git a/templates/single-product/add-to-cart/simple.php b/templates/single-product/add-to-cart/simple.php index 97c34117e59cf..d3b2ff46f6132 100644 --- a/templates/single-product/add-to-cart/simple.php +++ b/templates/single-product/add-to-cart/simple.php @@ -7,18 +7,23 @@ * @version 2.1.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $product; -if ( ! $product->is_purchasable() ) return; +if ( ! $product->is_purchasable() ) { + return; +} + ?> get_availability(); $availability_html = empty( $availability['availability'] ) ? '' : '

' . esc_html( $availability['availability'] ) . '

'; - + echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product ); ?> @@ -46,4 +51,4 @@ - \ No newline at end of file + diff --git a/templates/single-product/add-to-cart/variable.php b/templates/single-product/add-to-cart/variable.php index 7e3570afecda7..c673bc3b7a8ce 100644 --- a/templates/single-product/add-to-cart/variable.php +++ b/templates/single-product/add-to-cart/variable.php @@ -7,9 +7,12 @@ * @version 2.1.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $product, $post; + ?> diff --git a/templates/single-product/meta.php b/templates/single-product/meta.php index 6be8c43a56dc3..cac8bf11164d1 100644 --- a/templates/single-product/meta.php +++ b/templates/single-product/meta.php @@ -7,12 +7,15 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $post, $product; $cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) ); $tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) ); + ?>
@@ -30,4 +33,4 @@ -
\ No newline at end of file + diff --git a/templates/single-product/price.php b/templates/single-product/price.php index 51a0485949e7c..5655f597200c9 100644 --- a/templates/single-product/price.php +++ b/templates/single-product/price.php @@ -12,6 +12,7 @@ } global $product; + ?>
@@ -21,4 +22,4 @@ -
\ No newline at end of file + diff --git a/templates/single-product/product-attributes.php b/templates/single-product/product-attributes.php index da978fcf25d4e..0344f9dedd6be 100644 --- a/templates/single-product/product-attributes.php +++ b/templates/single-product/product-attributes.php @@ -18,6 +18,7 @@ $attributes = $product->get_attributes(); ob_start(); + ?> @@ -64,11 +65,11 @@ ?> - +
get_rating_count(); $average = $product->get_average_rating(); @@ -28,4 +31,4 @@ (' . $count . '' ); ?>) - \ No newline at end of file + diff --git a/templates/single-product/related.php b/templates/single-product/related.php index 0cf05398e36ea..1ad80e7f4b730 100644 --- a/templates/single-product/related.php +++ b/templates/single-product/related.php @@ -7,7 +7,9 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $product, $woocommerce_loop; diff --git a/templates/single-product/review.php b/templates/single-product/review.php index 510d8011c611e..5608ed3d8d7f2 100644 --- a/templates/single-product/review.php +++ b/templates/single-product/review.php @@ -9,9 +9,12 @@ * @version 2.1.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} $rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ); + ?>
  • id="li-comment-"> diff --git a/templates/single-product/sale-flash.php b/templates/single-product/sale-flash.php index 4bc8cb4a1e165..07bf12970c533 100644 --- a/templates/single-product/sale-flash.php +++ b/templates/single-product/sale-flash.php @@ -7,12 +7,15 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $post, $product; + ?> is_on_sale() ) : ?> ' . __( 'Sale!', 'woocommerce' ) . '', $post, $product ); ?> - \ No newline at end of file + diff --git a/templates/single-product/share.php b/templates/single-product/share.php index 069b86089034e..5d6cc1678c974 100644 --- a/templates/single-product/share.php +++ b/templates/single-product/share.php @@ -9,8 +9,10 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} ?> - \ No newline at end of file + diff --git a/templates/single-product/short-description.php b/templates/single-product/short-description.php index 1e9bb9c63ea6f..397f9b548f977 100644 --- a/templates/single-product/short-description.php +++ b/templates/single-product/short-description.php @@ -7,12 +7,17 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $post; -if ( ! $post->post_excerpt ) return; +if ( ! $post->post_excerpt ) { + return; +} + ?>
    post_excerpt ) ?> -
    \ No newline at end of file + diff --git a/templates/single-product/tabs/additional-information.php b/templates/single-product/tabs/additional-information.php index 24ae89046cb24..7ba92a861656f 100644 --- a/templates/single-product/tabs/additional-information.php +++ b/templates/single-product/tabs/additional-information.php @@ -1,24 +1,24 @@

    -list_attributes(); ?> \ No newline at end of file +list_attributes(); ?> diff --git a/templates/single-product/tabs/description.php b/templates/single-product/tabs/description.php index 69b163dec4d42..4df93804d6b09 100644 --- a/templates/single-product/tabs/description.php +++ b/templates/single-product/tabs/description.php @@ -7,11 +7,14 @@ * @version 2.0.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $post; $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) ); + ?> diff --git a/templates/single-product/tabs/tabs.php b/templates/single-product/tabs/tabs.php index 9c42da10212f3..3068f96878436 100644 --- a/templates/single-product/tabs/tabs.php +++ b/templates/single-product/tabs/tabs.php @@ -7,7 +7,9 @@ * @version 2.0.0 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} /** * Filter tabs and allow third parties to add their own @@ -38,4 +40,4 @@ - \ No newline at end of file + diff --git a/templates/single-product/title.php b/templates/single-product/title.php index 90e50281dbe84..82346e0be860b 100644 --- a/templates/single-product/title.php +++ b/templates/single-product/title.php @@ -7,7 +7,9 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} ?> -

    \ No newline at end of file +

    diff --git a/templates/single-product/up-sells.php b/templates/single-product/up-sells.php index b69db7c49db9a..39753269e2f3e 100644 --- a/templates/single-product/up-sells.php +++ b/templates/single-product/up-sells.php @@ -7,13 +7,17 @@ * @version 1.6.4 */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} global $product, $woocommerce_loop; $upsells = $product->get_upsells(); -if ( sizeof( $upsells ) == 0 ) return; +if ( sizeof( $upsells ) == 0 ) { + return; +} $meta_query = WC()->query->get_meta_query();