Permalink
Browse files

Fix indentation

  • Loading branch information...
robertstaddon committed Jul 3, 2018
1 parent 0a1891d commit 6984d784b3ab62afdbdd4b1d1bb17afcb1b2a96e
Showing with 9 additions and 9 deletions.
  1. +9 −9 woocommerce-auto-add-to-cart.php
@@ -14,9 +14,9 @@
// Check if WooCommerce is active (https://docs.woothemes.com/document/create-a-plugin/)
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
class WooCommerce_Auto_Add {
class WooCommerce_Auto_Add {
public function __construct() {
public function __construct() {
// Add product to cart (Use priority 11 just in case the Subscription plugin is removing all other products from the cart at priority 10)
add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'handle_add_to_cart' ), 11, 4 );
@@ -26,11 +26,11 @@ public function __construct() {
add_filter( 'woocommerce_get_settings_products', array( $this, 'woocommerce_auto_add_settings' ), 10, 2 );
}
/**
* Add to Cart action
/**
* Add to Cart action
* https://docs.woocommerce.com/document/automatically-add-product-to-cart-on-visit/
*/
public function handle_add_to_cart( $passed, $product_id, $quantity, $variation_id = '' ) {
*/
public function handle_add_to_cart( $passed, $product_id, $quantity, $variation_id = '' ) {
$trigger_category_id = get_option( 'woocommerce_auto_add_category_id' );
$auto_add_product_id = get_option( 'woocommerce_auto_add_product_id' );
@@ -56,7 +56,7 @@ public function handle_add_to_cart( $passed, $product_id, $quantity, $variation_
}
return $passed;
}
}
/**
@@ -170,7 +170,7 @@ private function woocommerce_auto_add_get_categories() {
return $categories;
}
}
new WooCommerce_Auto_Add;
}
new WooCommerce_Auto_Add;
}

0 comments on commit 6984d78

Please sign in to comment.