Botble Ecommerce
Use this when touching Botble ecommerce models, checkout, payment, orders, product queries, carts, or storefront product UI.
Domain Model
- Product hierarchy:
Product->ProductVariation->ProductVariationItem. - Order lifecycle:
PENDING->PROCESSING->COMPLETEDorCANCELED. - Key enums include
OrderStatusEnum,PaymentStatusEnum,ShippingStatusEnum,ProductTypeEnum, andStockStatusEnum. - Use Botble enum access rules:
getValue(),label(), string cast, or constants as appropriate.
Product Queries
- Use
Product::query(). - Eager load relations used by views/resources.
- When selecting image fields, include both
imageandimagesif accessors or galleries need them. - Keep filters composable and preserve existing
EcommerceHelperbehavior.
Payment Gateway Pattern
Follow the six-step pattern:
- Define constants and gateway identifiers.
- Register hook filters.
- Implement the payment service.
- Handle webhooks and status updates.
- Register routes.
- Add settings form fields.
Hooks
Use ecommerce hooks instead of editing core checkout/order flow directly. Common categories include order status changes, checkout payment filters, product display filters, cart updates, and post-payment callbacks.
Storefront
- Use Botble media helpers for product images.
- Use the existing infinite scroll pattern such as
bb-infinite-products-gridwhen extending product grids. - Keep price rendering through existing helpers such as
format_price(). - Preserve currency and language handling from ecommerce helpers.
Load References
Read references/ecommerce-patterns.md for snippets.