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

ConstantVisibilityTypeValue
CART_INDICATORpublicstring’cart.page_indicator’
CART_CREATORpublicstring’cart.page_creator’
MENU_ITEMpublicstring’cart.menu_item’
MINI_CARTpublicstring’cart.mini_cart’
CACHE_CONTROLpublicstring’cart.cache_control’
BUY_NOWpublicstring’cart.buy_now’
ADD_TO_CARTpublicstring’cart.add_to_cart’
RECOVER_FROM_CARTpublicstring’cart.recover_from_cart’
CHECKOUTpublicstring’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:

ParameterTypeDescription
$container\Pimple\ContainerThe dependency injection container used to manage services.


Automatically generated on 2025-01-21