Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

CartController::stock_exceptions_to_wp_errors( AutomatticWooCommerceBlocksStoreApiUtilitiesTooManyInCartException[] $too_many_in_cart_products, AutomatticWooCommerceBlocksStoreApiUtilitiesNotPurchasableException[] $not_purchasable_products, AutomatticWooCommerceBlocksStoreApiUtilitiesPartialOutOfStockException[] $partial_out_of_stock_products, AutomatticWooCommerceBlocksStoreApiUtilitiesOutOfStockException[] $out_of_stock_products )

This method will take arrays of exceptions relating to stock, and will convert them to a WP_Error object.


Description Description


Parameters Parameters

$too_many_in_cart_products

(Required) Array of TooManyInCartExceptions.

$not_purchasable_products

(Required) Array of NotPurchasableExceptions.

$partial_out_of_stock_products

(Required) Array of PartialOutOfStockExceptions.

$out_of_stock_products

(Required) Array of OutOfStockExceptions.


Top ↑

Return Return

(WP_Error[]) The WP_Error object returned. Will have errors if any exceptions were in the args. It will be empty if they do not.


Top ↑

Source Source

File: packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.