Developers can customise the behaviour of the minicart through filter hooks. There are some useful filter hooks supported by this plugin, and by WooCommerce itself.
Here’s some example code that uses these filter hooks:
woocommerce_
cart_ minicart_ icon - string $icon the HTML for the icon
- return: string
Change the icon for the minicart. You can return an image tag or SVG here if you prefer.
woocommerce_
lurking_ minicart_ classes - array $classes
- return: array
Add some custom classes to the wrapper for the minicart.
woocommerce_
lurking_ minicart_ css_ fixes - array $classes
- return: array
Add or remove direct CSS fixes applied via an inline style tag in the page header.
woocommerce_
lurking_ minicart_ is_ required - bool $required
- string $context can be ‘edge’, ‘widget’, ‘menu’, ‘manual’
- string $position can be ‘left’, ‘right’, ‘widget’, ‘menu’
- return: bool
Change whether the minicart is displayed on any given page. You can use this to hide the cart on specific pages, e.g. by testing for page IDs: is_page([12,13,14])
woocommerce_
lurking_ minicart_ position - string $position can be ‘left’, ‘right’, ‘widget’, ‘menu’
- return: string
Change where the minicart will sit on any given page.