1. Home
  2. WooCommerce Fast Cart
  3. Advanced Usage

How to trigger the fast cart programmatically

When you use the WooCommerce Fast Cart plugin, there are several built-in ways to open the cart popup:

  • If the Auto Open option is disabled then customers can click on a floating cart icon to open it.
  • Alternatively, if 'Auto Open' is enabled then the popup cart opens automatically when customers add products to the cart.
  • If the Replace Cart Page option is enabled then the popup cart will also open when a customer clicks on any link to the standard WooCommerce cart page.

Advanced Usage

Theme developers can also create custom buttons and links to trigger Fast Cart. When 'Replace Cart Page' is enabled, clicking on any element with the cart-contents class will open the cart popup, for example:

<button type="button" class="cart-contents">My Cart</button>

If this setting is not enabled, you can also use the data-open-wfc HTML attribute, this will always open Fast Cart regardless of Fast Cart's configuration.

<a href="/cart/" data-open-wfc="true">My Cart</a>
We've partnered with Codeable to provide our customers with expert help if required.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.