This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Disable Floating Cart

  • Creator
    Topic
  • #25456
    mizzinc
    Participant

    Hi Jason,

    How do we disable the floating cart from being outputted, would it have something to do with the add_filter( ‘themeblvd_do_cart’ ”)?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #25468
    Jason Bobich
    Keymaster

    Hi,

    Yeah, this should do it I think:

    add_filter('themeblvd_do_cart', '__return_false', 15);
    #25477
    mizzinc
    Participant

    I was using a low priority.

    Result: disabled the top header buttons, #floating-shopping-cart still outputs in the source.

    #25478
    Jason Bobich
    Keymaster

    In the theme’s WooCommerce compat class, you can see where add_filter('themeblvd_do_cart', '__return_true'); is added. Thus, this would be at default WP priority 10. So it’d make sense that using simply a higher priority than 10, would do the trick.

    Now, I’m a bit confused — Are you saying the line I provided works or doesn’t?

    #25480
    mizzinc
    Participant

    The line you provided works, by disabling the cart icon in the header, great!

    The floating cart HTML is still outputted in the source.

    <div id="floating-shopping-cart" class="tb-cart-popup modal fade"><div class="modal-dialog modal-sm">
    #25481
    Jason Bobich
    Keymaster

    Try this:

    /**
     * Action and filter mods for WooCommerce
     */
    function my_woocommerce_mods() {
    
        if ( ! class_exists('Theme_Blvd_Compat_WooCommerce') ) {
            return;
        }
    
        $tbwc = Theme_Blvd_Compat_WooCommerce::get_instance();
    
        add_filter( 'themeblvd_do_cart', '__return_false', 15 );
        remove_action( 'themeblvd_floating_cart', array($tbwc, 'cart') );
        remove_action( 'themeblvd_after', array($tbwc, 'add_cart') );
    
    }
    add_action( 'after_setup_theme', 'my_woocommerce_mods', 11 ); // Using priority 11, after framework

    Everything for WooCommerce compatibility is hooked in from the same class. So if there’s ever things implemented you want removed, you’ll find it all in the same place, which will be in the constructor method of the following class:

    /framework/compat/woocommerce/class-tb-compat-woocommerce.php

    Please see here so you understand the bigger concepts happenning with this:

    http://support.themeblvd.com/forums/topic/unhooking-or-modifying-tbs-woocommerce-actions-or-filters/#post-23093

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.