CartController
Woo Cart Controller class.
Description Description
Source Source
File: woocommerce/packages/woocommerce-blocks/src/RestApi/StoreApi/Utilities/CartController.php
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
Methods Methods
- add_to_cart — Based on the core cart class but returns errors rather than rendering notices directly.
- empty_cart — Empty cart contents.
- filter_request_data — Filter data for add to cart requests.
- get_cart_instance — Get main instance of cart class.
- get_cart_item — Return a cart item from the woo core cart class.
- get_cart_items — Returns all cart items.
- get_product_for_cart — Get a product object to be added to the cart.
- get_variable_product_attributes — Get product attributes from the variable product (which may be the parent if the product object is a variation).
- get_variation_id_from_variation_data — Try to match request data to a variation ID and return the ID.
- parse_variation_data — If variations are set, validate and format the values ready to add to the cart.
- sanitize_variation_data — Format and sanitize variation data posted to the API.