[MarketPress eCommerce] Floating minicart

I have tried several ways of initiating the MP Cart class and trying to call the floating_cart_html() function so as to have it on all pages of my website like in class-mp-cart.php
add_action( 'wp_footer', array( &$this, 'floating_cart_html' ) );

The not having an easy option to include the floating cart in every page on the website is absurd. The shopping cart widget that you have isn't anything like the floating cart that is already available and should be available as an option or at the least only require a few lines of code to implement. That's a standard feature for a shopping cart.

I know there is a learning curve, but your documentation is severely lacking. With that said, I do love the automate, hummingbird, defender, and smush products and ability to send out reporting.

  • Patrick Freitas

    Hi Wendy

    How are you today?

    Sorry to hear that you are having to deal with it. I would suggest you open a new thread as Feature & Request about it, if the members vote and it become popular this feature can be considered on a future release.

    However you can use this function to show the Mini Cart on pages. I would suggest use it as MU-Plugin, to do it, create a .php file on wp-content/mu-plugins directory, it the folder mu-plugins doesn't exist you can create it.

    You can read more about Mu-Plugin here:
    https://codex.wordpress.org/Must_Use_Plugins

    On the .php file that you created paste this code:

    <?php
    add_filter( 'mp_cart_needed_on_page', '__return_true' );
    add_action( 'init', function() {
            require_once WP_PLUGIN_DIR . '/marketpress/includes/common/class-mp-product.php';
            require_once WP_PLUGIN_DIR . '/marketpress/includes/common/helpers.php';
            require_once WP_PLUGIN_DIR . '/marketpress/includes/common/class-mp-cart.php';
    
            $cart = new MP_Cart();
            add_action( 'wp_footer', array( $cart, 'floating_cart_html' ) );
    } );
    ?>

    Now the floating cart should be showing on the pages.

    Best Regards,
    Patrick Freitas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.