Shopping Cart Widget

Any way to hardcode the shopping cart widget?

  • DavidM
    • DEV MAN’s Mascot

    Hi Daniel and welcome to WPMU DEV!

    By hard-coding, do you mean to code the cart into your own theme? If so, that's easy enough if you take a look at marketpress\marketpress-includes\template-functions.php. Line 710 reads as follows:
    function mp_show_cart($context = '', $checkoutstep = null, $echo = true)

    You can simply call that function mp_show_cart() where you like in your own theme file. Is that maybe what you're looking for?


  • Mason
    • DEV MAN’s Sidekick

    Hiya Daniel,

    There's no way to hardcode the shopping cart widget exactly. You'll have to go through the MarketPress plugin - look at marketpress/marketpress-includes/template-functions.php for examples.

    There's a ton of functions to get you what you want. For example, here's what the new GridMarket theme uses:
    <?php mp_show_cart('checkout'); ?>

    That function outputs the shopping cart - which you can then style within your theme.

    Hope this helps!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.