Products
Product Management Overview
The Products module stores every SKU in the products table and exposes them through REST endpoints that both the React admin and storefront shortcodes consume.
How the products screen works
- React admin list: The list view (see screenshot) calls
ProductController::index()with search, status, and category filters. Actions include Edit, Delete, and opening the category manager. - Storefront parity:
[kitbix_commerce_products]reusesProductController::publicIndex(), so pagination, stock badges, and category filters match what admins see. - Categories modal: Clicking “Manage Categories” opens the tree powered by
CategoryController. Any change updates thecategory_productpivot instantly. - Product editor: The single edit form writes via
ProductController::update(), handling media galleries, pricing, and category assignment in one payload.
Workflow from admin to storefront
- Create or edit a product inside Kitbix Commerce → Products.
- Assign categories so storefront filters populate (UI posts
categoriesarray, controller filters nonexistent IDs). - Save.
ProductControllerpersists the record and emitskitbix_commerce_product_savedfor addons. - Reload the storefront product grid; it calls the public endpoint and reflects the new card, pricing, stock badge, and permalink.
- Open the product detail page rendered by
public/templates/product-single.phpto verify gallery images and descriptions.
Screenshot: Products list inside wp-admin showing search, filters, “Add Product”, and inline edit/delete actions.
Use captures from your own environment to replace placeholders before publishing docs.
Tips & best practices
Tip: Use the “Refresh Data” button in the admin list if you update products via REST; it re-queries
ProductController::index() without a full reload.Tip: Keep product slugs human-readable. Storefront permalinks are generated from the slug using
kitbix_commerce_product_permalink().Common mistakes
- Deleting products that are still referenced by orders—there is no cascade cleanup.
- Forgetting to re-sync categories after importing products; the pivot table stays empty unless
Category::syncProductCategories()runs.
Reminder: Product data is independent of WordPress posts. Back up the
products, categories, and category_product tables before bulk edits.