woocommerce_get_product_from_item

woocommerce_get_product_from_item

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_get_product_from_item') is found 2 times:

  • /includes/class-wc-order-item-product.php line 357
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
        }
     
        // Backwards compatible filter from WC_Order::get_product_from_item().
        if ( has_filter( 'woocommerce_get_product_from_item' ) ) {
            $product = apply_filters( 'woocommerce_get_product_from_item', $product, $this, $this->get_order() );
        }
     
        return apply_filters( 'woocommerce_order_item_product', $product, $this );
    }
     
    /**
  • /includes/legacy/abstract-wc-legacy-order.php line 329
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
            $product = $item->get_product();
        } else {
            $product = false;
        }
        return apply_filters( 'woocommerce_get_product_from_item', $product, $item, $this );
    }
     
    /**
     * Set the customer address.
     * @param array $address Address data.
     * @param string $type Type of address; 'billing' or 'shipping'.