Skip to main content
These filters allow you to customize the cart experience.

sc_cart_menu_icon

Filter the cart menu icon.
Parameters
Filter Parameters
add_filter( 'sc_cart_menu_icon', function( $icon, $type ) {
    return 'shopping-bag'; // Use a different icon
}, 10, 2 );

sc_cart_disabled

Disable the cart functionality entirely on specific pages or conditions.
add_filter( 'sc_cart_disabled', function( $disabled ) {
    // Disable cart on specific pages
    if ( is_page( 'landing-page' ) ) {
        return true;
    }
    return $disabled;
} );

// Or disable during maintenance
add_filter( 'sc_cart_disabled', function( $disabled ) {
    if ( get_option( 'maintenance_mode' ) ) {
        return true;
    }
    return $disabled;
} );

Use Cases

Hide Cart on Landing Pages

add_filter( 'sc_cart_disabled', function( $disabled ) {
    // Hide cart on specific landing pages
    $landing_pages = [ 'promo', 'special-offer', 'webinar' ];
    
    foreach ( $landing_pages as $slug ) {
        if ( is_page( $slug ) ) {
            return true;
        }
    }
    
    return $disabled;
} );

Disable Cart for Logged-Out Users

add_filter( 'sc_cart_disabled', function( $disabled ) {
    // Only show cart to logged-in users
    return ! is_user_logged_in();
} );

Modifying Templates

You can customize the HTML output of SureCart blocks using WordPress’s render_block filter and the HTML Tag Processor.

Templates

Learn how to modify block HTML, add custom attributes, wrap content, and inject elements into templates.

Checkout

Customize checkout validation and behavior.

Templates

Modify how content is displayed.