WordPress.org

Forums

WooCommerce Payment Gateway - Inspire
Plugin bug. not enable shipping methods. (1 post)

  1. Genc Medya
    Member
    Posted 1 year ago #

    hii turkey :)
    this plugin not enabled shipping method. but not include this code.

    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();
    	}

    add code to class-wc-custom_payment_gateway_1.php okey ? see you later. my bad english for sorry.

    http://wordpress.org/plugins/woocommerce-payment-gateway/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by Genc Medya
  • This topic is not a support question
  • WordPress version: 3.8

Tags

No tags yet.