Shopping Cart mp_cart.php features seem to be missing in Marketpress

The shopping cart mp_cart.php file is having issues.

For the code I am using I have

<?php get_header(); ?>

<?php echo mp_show_cart(); ?>

<?php get_footer(); ?>

It is missing many of the features that the virtual shopping cart page has. Is this a glitch or is there a way to bring those in.
I have included a screenshot of the shopping cart using the code supplied from template-function.php and then a screenshot of the virtual page to show the differences.


  • Alexander
    • DEV MAN’s Mascot

    Hi @TimMorris-Design,

    I think this might be because the layout is a bit broken
    Rather than just outputting with a header and footer, I would recommend trying to render this within your page template.

    So perhaps copy page.php and place the cart where the content would normally go.

    Best regards,

  • TimMorris-Design
    • The Incredible Code Injector

    Hello Alexander,
    I put it within a page template within the loop using the following code, attaching it to a page called shopping-cart.

    Template Name: Shopping Cart
    <?php get_header(); ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    				<?php echo mp_show_cart(); ?>
    		<?php endwhile; endif; ?>
    <?php get_footer(); ?>

    Nothing seemed to change. Then I inspected the css more and noticed that some of the classes looked like they could also be function names. I found mp_cart_breadcrumbs(); in template-functions.php and when I put it in the loop and it showed the breadcrumbs. This was not given at the top of template-functions.php. I am thinking there are other functions that dynamically output the rest of what I see in the virtual shopping cart that should be at the top of template-functions.php or all of those functions supposed to be included in mp_show_cart()?

    I think in the end I will just style the classes given in the virtual page.


  • Alexander
    • DEV MAN’s Mascot

    Hi @TimMorris-Design,

    I'm sorry about the delay getting back to you here. I'm actually not 100% positive on how this would need to happen. I'm sorry for not having more info at the moment.

    Let me check with my colleague @aristath for some advice here.


  • aristath
    • Recruit

    Hello there @TimMorris-Design,
    I think your issue is this line:
    <?php echo mp_show_cart(); ?>
    The mp_show_cart() function already echoes the content, so you shouldn't echo it.
    Double-echoing it is probably what causes this.
    Try replacing the above line with this:
    <?php mp_show_cart(); ?>

    Let me know if that works!

    Take care and have a wonderful Christmas!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.