OrderController
OrderController class.
Description Description
Helper class which creates and syncs orders with the cart.
Source Source
File: packages/woocommerce-blocks/src/StoreApi/Utilities/OrderController.php
Methods Methods
- create_order_from_cart — Create order and set props based on global settings.
- default_order_status — Changes default order status to draft for orders created via this API.
- get_coupon — Convert a coupon code to a coupon object.
- sync_customer_data_with_order — Copies order data to customer object (not the session), so values persist for future checkouts.
- update_addresses_from_cart — Update address data from cart and/or customer session data.
- update_line_items_from_cart — Create order line items.
- update_order_from_cart — Update an order using data from the current cart.
- validate_address_fields — Check all required address fields are set and return errors if not.
- validate_addresses — Validates customer address data based on the locale to ensure required fields are set.
- validate_allowed_country — Check all required address fields are set and return errors if not.
- validate_coupon_email_restriction — Check email restrictions of a coupon against the order.
- validate_coupon_usage_limit — Check usage restrictions of a coupon against the order.
- validate_coupons — Validate coupons applied to the order and remove those that are not valid.
- validate_email — Validates the customer email. This is a required field.
- validate_order_before_payment — Final validation ran before payment is taken.