Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hello! I fixed this problem. You must add the following code in the plugin files between:

    ‘options’ => $shipping_methods,
    ‘desc_tip’ => true,
    )
    );

    }

    and

    /* Process the payment and return the result. */
    function process_payment ($order_id) {

    function is_available() {
    		global $woocommerce;
    
    		if ( ! empty( $this->enable_for_methods ) ) {
    
    			if ( is_page( woocommerce_get_page_id( 'pay' ) ) ) {
    
    				$order_id = (int) $_GET['order_id'];
    				$order = new WC_Order( $order_id );
    
    				if ( ! $order->shipping_method )
    					return false;
    
    				$chosen_method = $order->shipping_method;
    
    			} elseif ( empty( $woocommerce->session->chosen_shipping_method ) ) {
    				return false;
    			} else {
    				$chosen_method = $woocommerce->session->chosen_shipping_method;
    			}
    
    			$found = false;
    
    			foreach ( $this->enable_for_methods as $method_id ) {
    				if ( strpos( $chosen_method, $method_id ) === 0 ) {
    					$found = true;
    					break;
    				}
    			}
    
    			if ( ! $found )
    				return false;
    		}
    
    		return parent::is_available();
    	}
Viewing 1 replies (of 1 total)