Merge pull request #6047 from GeertDD/wc_global

Removed unused global $woocommerce variable from the templates
This commit is contained in:
Mike Jolley 2014-08-18 13:28:34 +01:00
commit a54cf4b189
17 changed files with 7 additions and 27 deletions

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
wc_print_notices();
do_action( 'woocommerce_before_cart' ); ?>

View File

@ -9,7 +9,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $product, $woocommerce, $woocommerce_loop;
global $product, $woocommerce_loop;
$crosssells = WC()->cart->get_cross_sells();

View File

@ -10,8 +10,6 @@
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
?>
<?php do_action( 'woocommerce_before_mini_cart' ); ?>

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
if ( get_option( 'woocommerce_enable_shipping_calc' ) === 'no' || ! WC()->cart->needs_shipping() )
return;
?>

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
wc_print_notices();
do_action( 'woocommerce_before_checkout_form', $checkout );

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
if ( ! WC()->cart->coupons_enabled() ) {
return;
}

View File

@ -8,8 +8,6 @@
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
?>
<form id="order_review" method="post">

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
if ( $order ) : ?>
<?php if ( $order->has_status( 'failed' ) ) : ?>

View File

@ -11,8 +11,6 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $woocommerce;
foreach ( $items as $item ) :
$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );

View File

@ -11,8 +11,6 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $woocommerce;
foreach ( $items as $item ) :
$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );

View File

@ -11,7 +11,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $wp_query;
global $wp_query;
if ( ! woocommerce_products_will_display() )
return;

View File

@ -9,7 +9,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $post;
global $post;
?>
<form action="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" method="post" class="track_order">

View File

@ -9,8 +9,6 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
$order = wc_get_order( $order_id );
?>
<h2><?php _e( 'Order Details', 'woocommerce' ); ?></h2>

View File

@ -6,7 +6,7 @@
* @package WooCommerce/Templates
* @version 2.1.0
*/
global $woocommerce, $product;
global $product;
if ( ! defined( 'ABSPATH' ) )
exit; // Exit if accessed directly

View File

@ -9,7 +9,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $product;
global $product;
if ( ! $product->is_purchasable() ) return;
?>

View File

@ -9,7 +9,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $product, $post;
global $product, $post;
?>
<?php do_action( 'woocommerce_before_add_to_cart_form' ); ?>

View File

@ -9,7 +9,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $post;
global $post;
$heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) );
?>