Customers, Filters, Reviews and Wishlists
Understand account and merchandising hooks without treating cached identity or optimistic results as server acceptance.
Customers, filters, reviews and wishlists
Customer workflows
useWpCustomer() exposes isLoggedIn, customer, orders, downloads, login, register, logout, updateProfile, updateAddress, refreshOrders, refreshCustomer, loading and error. Login/register can reject; handle their promises. Cached forgewp-customer and forgewp-customer-orders data is display state, not authenticated server identity.
Commerce logout currently sends a POST without the JSON body/header and REST nonce required by the current generated Auth guard, ignores failure and clears local identity. It does not establish a verified server logout. Reconcile this integration before shipping account UI. The commerce hook is separate from @forgewp/auth and does not inherit its newer session/error behavior.
Commerce registration expects a user response. Generated Auth signup can instead return successful account creation requiring verification without a signed-in user. Verify that branch before using commerce registration with verification-required signup; consult the Auth registration contract.
Order/download requests include credentials and optional JWT but do not attach the hydrated REST nonce in that helper. Verify real cookie authentication and record ownership. Do not use local profile/address fallbacks or cached orders to authorize access to private data.
Filters
useWpProductFilters() returns activeFilters, setFilter(type, value, active), setPriceRange(min, max), setSortBy(sort) and resetFilters. It reads/updates URL parameters including product_cat, product_tag, filter_*, price bounds, orderby and search. A state change is not itself a catalog query: connect the intended inputs explicitly and verify server filter semantics. Local useWpProducts does not implement equivalent filtering.
Reviews
useWpProductReviews(productId, { perPage?, initialSort? }) supplies collections, the current-user review, metrics, page/sort setters, load-more state and submit/delete/refresh actions. Sort values are newest, oldest, highest and lowest. submitReview takes author, optional email, content and rating; deleteReview() does not accept an arbitrary review ID.
Live requests use generated product-review routes. Test guest/signed-in ownership, moderation visibility, deletion and abuse controls in WordPress. Fixture reviews do not establish moderation or authorization behavior.
Wishlists
useWpWishlist() returns wishlist, count, isWishlisted, toggleWishlist, refreshWishlist, loading and error. IDs are stored in forgewp-wishlist; signed-in synchronization is attempted through custom routes. A toggle can keep an optimistic change and return success after an unsuccessful server request. Separate hook instances are not a documented reactive shared store. Verify persistence and cross-component updates before promising synchronization.
WpWishlistButton and WpWishlistList provide convenience views, not an authorization policy.