woocommerce_pay_order_product_in_stock

woocommerce_pay_order_product_in_stock

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

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_pay_order_product_in_stock') is found 2 times:

  • /includes/shortcodes/class-wc-shortcode-checkout.php line 153
    								if ( ! $product ) {
    									continue;
    								}
    
    								if ( ! apply_filters( 'woocommerce_pay_order_product_in_stock', $product->is_in_stock(), $product, $order ) ) {
    									/* translators: %s: product name */
    									throw new Exception( sprintf( __( 'Sorry, "%s" is no longer in stock so this order cannot be paid for. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name() ) );
    								}
    
    								// We only need to check products managing stock, with a limited stock qty.
    								if ( ! $product->managing_stock() || $product->backorders_allowed()  ) {
    
  • /src/StoreApi/Utilities/OrderController.php line 627
    						 * @param \WC_Order $order Order.
    						 *
    						 * @since 9.8.0-dev
    						 */
    						if ( ! apply_filters( 'woocommerce_pay_order_product_in_stock', $product->is_in_stock(), $product, $order ) ) {
    							return array(
    								'code'    => 'woocommerce_rest_out_of_stock',
    								/* translators: %s: product name */
    								'message' => sprintf( __( 'Sorry, "%s" is no longer in stock so this order cannot be paid for. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name() ),
    							);
    						}