What’s New in
Creation
Build courses visually, faster.
Engagement
Keep learners hooked.
Monetization
Sell courses your way.
Management
Run everything in one place.
Engagement
Monetization
Management
Add-Ons
Unlock more possibilities for your LMS.
Integrations
Connect with tools you already use.
Migration
Switch to Tutor LMS with confidence.
Blog
Learn, grow, and stay ahead in eLearning.
Documentation
Everything you need to build with Tutor LMS.
Videos
Learn visually with tutorials.
Release Notes
See what’s new in every update.
Partners
Explore our trusted Tutor LMS partners.
Themes
Exclusive Tutor LMS themes.
Tutor LMS includes a dedicated Cart Button for its native eCommerce system. It gives learners a quick way to open their cart and review selected courses before checkout.
The Cart Button is available only when Tutor LMS Native eCommerce is selected as the active eCommerce engine. To enable it, go to Tutor LMS > Settings > Monetization and select Native under Select eCommerce Engine. Make sure a Cart Page and Checkout Page are also configured.
Note: When another monetization method is active, the Cart Button does not output.

If your website uses a block-based theme, you can use the WordPress Site Editor to add the Cart Button block directly to your global header.
| Setting | Description |
|---|---|
| Cart Icon | Choose between Cart, Bag, or Basket. |
| Icon Size | Set the icon size. |
| Cart Item Count | Choose whether the item count is shown Always (even if empty), Only if has items, or Never. |
| Custom CSS Class | Add a custom CSS class to the block wrapper. |
Classic themes can display the Cart Button using either a shortcode or a PHP function.
The shortcode is convenient for content areas, text widgets, and compatible page builders. The PHP function is better suited to developers adding the button directly to a theme template or custom header.
Use the following shortcode to display the default Cart Button:
[tutor_cart_button]
| Attribute | Default | |
|---|---|---|
| class | tutor-cart-button | Adds a custom CSS class to the button. |
| title | View your shopping cart | Sets the link’s title attribute. |
| show_count | if_has_items | Controls when the cart item count is displayed. Supported values: always, if_has_items, and never. |
| cart_icon | cart | Sets the icon displayed by the button. Supported values: cart, bag, and basket. |
For example:
[tutor_cart_button class=”header-cart” cart_icon=”bag” show_count=”always”]
This example adds the header-cart CSS class, uses the bag icon, and always displays the cart item count.
Developers can render the Cart Button directly from a theme template using:
<?php
tutor_ecommerce_cart_button();
?>
For custom themes, a function_exists() check can prevent errors if Tutor LMS is inactive:
<?php
if ( function_exists( 'tutor_ecommerce_cart_button' ) ) {
tutor_ecommerce_cart_button();
}
?>PHP Parameters
The function accepts an array of parameters for further customization:
| Parameter | Default | Description |
|---|---|---|
| class | tutor-cart-button | Custom CSS class. |
| title | View your shopping cart | Title attribute for the cart link. |
| show_count | if_has_items | Controls cart count visibility. |
| cart_icon | cart | Sets the cart icon. |
| icon_svg | ” | Supplies custom SVG markup for the icon. |
For example, the following displays the basket icon and always shows the cart count:
<?php
tutor_ecommerce_cart_button(
array(
'cart_icon' => 'basket',
'show_count' => 'always',
)
);
?>
Developers building a fully custom cart interface can retrieve individual pieces of cart data instead of rendering the complete button.
Get the Cart Item Count:
$count = tutor_ecommerce_get_cart_count();
This returns the current number of items in the cart.
Get the Cart Icon SVG:
$svg = tutor_ecommerce_get_cart_icon_svg( ‘bag’ );
The function returns the SVG markup for the specified icon. Supported icon names include cart, bag, and basket.
Tutor LMS provides WordPress filters for developers who need site-wide customization.
The tutor_ecommerce_cart_button_args filter can modify the default arguments passed to the Cart Button:
add_filter( 'tutor_ecommerce_cart_button_args', function( $args ) {
$args['cart_icon'] = 'bag';
$args['class'] = 'my-header-cart';
return $args;
} );
Customize the Cart Icon SVG
The tutor_ecommerce_cart_icon_svg filter can modify or replace the SVG markup returned for an icon:
add_filter( 'tutor_ecommerce_cart_icon_svg', function( $svg, $icon ) {
if ( 'custom' === $icon ) {
return '<svg ...>...</svg>';
}
return $svg;
}, 10, 2 );
The Cart Button supports CSS variables that can be used to adjust its appearance without replacing the button markup.
For example:
.tutor-cart-button {
--tutor-cart-icon-size: 24px;
--tutor-cart-icon-color: #2c3e50;
--tutor-cart-badge-bg: #0c111d;
--tutor-cart-badge-color: #ffffff;
}
These variables control the icon size, icon color, badge background, and badge text color. The values shown above are example customizations.
By submitting your email, you agree to our Terms and Privacy Policy
Build, manage, and scale your eLearning business with the most powerful WordPress LMS — all in one place.
Crafted by Humans
© 2026 All Rights Reserved