ClassesBigCommerceAmpAmp Cart Menu Item

Amp_Cart_Menu_Item

Class Amp_Cart_Menu_Item

Enhances the cart menu item with AMP-specific functionality, such as adding classes and dynamic cart item counts using AMP components.

  • Full name: \BigCommerce\Amp\Amp_Cart_Menu_Item

Methods

add_classes_to_cart_page

Adds AMP-specific classes and cart item count functionality to the cart menu item.

public add_classes_to_cart_page(object $menu_item, string $proxy_base): object

Adds a menu-item-bigcommerce-cart class to the cart menu item and replaces the menu item’s title with dynamic AMP-powered content that displays the current cart item count.

Parameters:

ParameterTypeDescription
$menu_itemobjectThe menu item object.
$proxy_basestringThe base URL or namespace used for proxying API requests.

Return Value:

Filtered menu item with added AMP-specific functionality.



Automatically generated on 2025-01-21