WooCommerce: Webhook disabled on its own

If you don’t want to fix this every time WooCommerce updates, just create a filter in your child-theme: function overrule_webhook_disable_limit( $number ) { return 999999999999; //very high number hopefully you’ll never reach. } add_filter( ‘woocommerce_max_webhook_delivery_failures’, ‘overrule_webhook_disable_limit’ );

how to use wc_create_order with subscription product

Here’s my code for creating a subscription — it took a lot of trial and error to figure it all out. Best of luck! function create_test_sub() { $email=”[email protected]”; $start_date=”2015-01-01 00:00:00″; $address = array( ‘first_name’ => ‘Jeremy’, ‘last_name’ => ‘Test’, ‘company’ => ”, ’email’ => $email, ‘phone’ => ‘777-777-777-777’, ‘address_1′ => ’31 Main Street’, ‘address_2’ => … Read more

Display single product attribute value on Shop page (Woocommerce)

Just use global $product then use get_attribute() method of that product object, like below- $size = $product->get_attribute( ‘pa_size’ ); And you can also get that by below code- global $product; $size = array_shift( wc_get_product_terms( $product->id, ‘pa_size’, array( ‘fields’ => ‘names’ ) ) ); Rememeber you need to use must the global $product.

How to check if is in cart page? [closed]

I’m not sure where are you hooking your function to, but you might be doing it too early. Hook to template_redirect, and then redirect the user: add_action(‘template_redirect’,’redirect_visitor’); function redirect_visitor(){ if ( is_page( ‘cart’ ) || is_cart() ) { wp_safe_redirect(site_url()); exit(); // Don’t forget this one } }

Are there any hook or filter when refund is done through admin -woocommerce

Although this answer is little late but anyone else may get benefit from it. The woocommerce_order_refunded hook is called when an order is refunded. Use the following example: // add the action add_action( ‘woocommerce_order_refunded’, ‘action_woocommerce_order_refunded’, 10, 2 ); // Do the magic function action_woocommerce_order_refunded( $order_id, $refund_id ) { // Your code here }

How to add a new endpoint in woocommerce

seems woocommerce doesn’t have any filters when registering their endpoints, https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-query.php#L84 so you need to add your new endpoint on init hooks, just like this add_action( ‘init’, ‘add_endpoint’ ); function add_endpoint(){ add_rewrite_endpoint( ‘license’, EP_ROOT | EP_PAGES ); } then you have to do some filtering on wc_get_template to call your files when the request match … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)