woocommerce_helper_subscription_deactivate_error

woocommerce_helper_subscription_deactivate_error

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_helper_subscription_deactivate_error') is found 2 times:

  • /includes/admin/helper/class-wc-helper.php line 1194
    			 * @param int    $product_id Product ID being deactivated.
    			 * @param string $product_key Subscription product key.
    			 * @param array  $deactivation_response The response object from wp_safe_remote_request().
    			 */
    			do_action( 'woocommerce_helper_subscription_deactivate_error', $product_id, $product_key, $deactivation_response );
    
    			$body = json_decode( wp_remote_retrieve_body( $deactivation_response ), true );
    			throw new Exception( $body['message'] ?? __( 'Unknown error', 'woocommerce' ) );
    		}
    
    		self::_flush_subscriptions_cache();
    
  • /includes/admin/helper/class-wc-helper.php line 2118
    				 * @param int    $product_id Product ID being deactivated.
    				 * @param string $product_key Subscription product key.
    				 * @param array  $deactivation_response The response object from wp_safe_remote_request().
    				 */
    				do_action( 'woocommerce_helper_subscription_deactivate_error', $product_id, $product_key, $deactivation_response );
    			}
    		}
    
    		if ( $deactivated ) {
    			self::log( sprintf( 'Auto-deactivated %d subscription(s) for %s', $deactivated, $filename ) );
    			self::_flush_subscriptions_cache();