Cart
Cart service provider for managing cart-related functionality.
The Cart
class registers various cart-related services in the container, such as:
- Menu item for the cart
- Mini cart functionality
- Cache control for cart and checkout pages
- Buy Now functionality
- Add to Cart and Cart Recovery services
- Checkout service
The class also sets up necessary action and filter hooks to integrate these services into the WordPress environment, ensuring that cart operations are handled effectively.
- Full name:
\BigCommerce\Container\Cart
- Parent class:
Provider
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
CART_INDICATOR | public | string | ’cart.page_indicator’ |
CART_CREATOR | public | string | ’cart.page_creator’ |
MENU_ITEM | public | string | ’cart.menu_item’ |
MINI_CART | public | string | ’cart.mini_cart’ |
CACHE_CONTROL | public | string | ’cart.cache_control’ |
BUY_NOW | public | string | ’cart.buy_now’ |
ADD_TO_CART | public | string | ’cart.add_to_cart’ |
RECOVER_FROM_CART | public | string | ’cart.recover_from_cart’ |
CHECKOUT | public | string | ’cart.checkout’ |
Methods
register
Registers the cart-related services and hooks within the container.
public register(\Pimple\Container $container): void
This method registers various cart-related services such as the menu item, mini cart, cache control, buy now functionality, add-to-cart functionality, and checkout services within the container. It also sets up action and filter hooks to manage cart behavior throughout the application.
Parameters:
Parameter | Type | Description |
---|---|---|
$container | \Pimple\Container | The dependency injection container used to manage services. |
Automatically generated on 2025-01-21