Can you build a headless store on the Store API?
Yes, that's its main use case together with blocks. But payment on an external frontend depends on the payment gateway: not every gateway supports paying through the Store API.
questions
Yes, that's its main use case together with blocks. But payment on an external frontend depends on the payment gateway: not every gateway supports paying through the Store API.
No, it's the customer's public API. Changes need the Nonce header (CSRF protection) and a session or a Cart-Token.
woocommerce_cart_calculate_fees and $cart->add_fee( $name, $amount, $taxable ). Fees are calculated on the server, so they work in both checkouts.
With the Additional Checkout Fields API: woocommerce_register_additional_checkout_field() on the woocommerce_init hook, with an id in the namespace/name format, a location and a field type.
With woocommerce_store_api_register_endpoint_data() for the endpoint you need (cart, cart item). The data shows up in the extensions.<namespace> field.
A check in woocommerce_check_cart_items with an error through wc_add_notice(): a cart with an error won't pass checkout, neither in the template nor through the Store API.
A draft order that block checkout creates while the customer fills in the form. It isn't visible as a regular order and is cleaned up on a schedule if the purchase isn't completed.
Everything that happens to the cart and the order on the server: fee and price calculation, coupons, woocommerce_new_order, status changes, woocommerce_payment_complete.
The form is rendered by React on the client, and the data goes as a JSON request to the Store API. There is no PHP form template, so the hooks that inserted HTML into the form or read $_POST aren't there either.
No questions found. Try another search.