Using MarketPress, how do I just show a shopping cart widget on all shopping related pages?

Using a shopping cart on this site - http://boaztrust.org.uk/store/ - wanting to show a shopping cart, but only on pages related to the shop.

How do I do this?

  • gina
    • The Bug Hunter

    I want to say this is something in the works. Aaron has mentioned it I believe.

    But one thing you can do is add shopping cart shortcodes to the tops of the shopping cart pages in marketpress settings. Then a link to "view cart/checkout" will be easily noticeable to the customer.

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    Yeah, this is something we plan to improve upon in the future. For now, you could do a hardcode in the template or you could create a page template for marketpress pages with it's own sidebar and widget area. Then just load that widget into the area, recreate the marketpress pages (store, products, etc) and use this page template (and thus sidebar and widget area).

    It's a bit more work that way, but would also get the job done.

    Thanks!

  • Mason
    • DEV MAN’s Sidekick

    Hiya Chris,

    Just name the product page template mp-product.php and marketpress will use it.

    Check out marketpress/marketpressincludes/themes/Themeing_MarketPress.txt for tons of info on how you can create/edit MarketPress pages in your theme. Very handy :slight_smile:

  • Jonathan
    • The Incredible Code Injector

    Check out marketpress/marketpressincludes/themes/Themeing_MarketPress.txt for tons of info on how you can create/edit MarketPress pages in your theme.

    @masonjames - is that where you guys hide the cookie jar - lol :wink:

    -----

    @bigonroad - glad you're sorted now :wink:

  • Chris
    • The Bug Hunter

    Okay, now I'm trying to show the product sidebar on product pages. I've got it on the main store: http://boaztrust.org.uk/store

    But on the product pages, if I take the page template, rename it mp_product.php, it shows the sidebar, but I lose the featured image, the buy it now, and everything.

    Why?

    In other words, when using default wp page template, it shows all e-commerce details. When i rename page.php as mp_product.php, it doesn't show any of them.

  • Jonathan
    • The Incredible Code Injector

    When I said that masonjames has been hiding the cookie jar - I ment that what he said was a great resource.
    marketpress/marketpressincludes/themes/Themeing_MarketPress.txt
    In it it lists all the template structures you could ever dream of using.
    File names for store templates in order:

    Single Product Page
        mp_product-PRODUCTNAME.php
        mp_product-PRODUCTID.php
        mp_product.php
    
      Store Page
        mp_store.php
    
      Cart/Checkout Page
        mp_cart.php
    
      Order Status Page
        mp_orderstatus.php
    
      Product List Page
        mp_productlist.php
    
      Product Category List Page
        mp_category-CATEGORYSLUG.php
        mp_category-CATEGORYID.php
        mp_category.php
        mp_taxonomy.php
        mp_productlist.php
    
      Product Tag List Page
        mp_tag-TAGSLUG.php
        mp_tag-TAGID.php
        mp_tag.php
        mp_taxonomy.php
        mp_productlist.php

    I like these

    Single Product Page
        mp_product-PRODUCTNAME.php
        mp_product-PRODUCTID.php
        mp_product.php

    So, I would Create a file - sidebar-product.php

    Then create relavant pages and insert...
    I use a custom function - you can create your own. Replace the get sidebar stuff with your custom function that
    <?php get_template_part( 'sidebar', 'product' ); // Loads the sidebar-product.php template. ?>

    And insert that into relevant page templates (mp_product.php)

    That should do it.

  • Jonathan
    • The Incredible Code Injector

    Oh, missed the second image...

    Something is wrong with your template, you're missing code.
    What is the template structure you are using - check the code your using inside. Obviously you aren't pulling in the image etc

    For example you're missing
    <div class="product-photo"><?php mp_product_image(true, 'single', null); ?></div>

    Try downloading gridmarket theme and working off of that - it has everything you are wanting to do.

  • Chris
    • The Bug Hunter

    My point is that using the default page.php - as in no mp_xxx template, MP puts all the details in, quantity, category, etc.

    When i copy page.php, and rename it mp_product.php, adding my own sidebar, it loses all that. Granted, I get my custom sidebar, but the product page sucks.

    Ie. my page.php:

    <?php get_header(); ?>
    
    <div id="page" class="clearfix">
    	<div id="content" class="page-left clearfix">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<h1><?php the_title(); ?></h1>
    		<?php the_content(__('Read more', 'organizedthemes'));?>
    		<?php endwhile; else: ?>
    		<p><?php _e('Sorry, no posts matched your criteria.', 'organizedthemes'); ?></p><?php endif; ?>
    		<?php include(TEMPLATEPATH."/includes/paging.php");?>
    	</div>
    	<div id="sidebar" class="page-right">
    		<?php get_sidebar('page'); ?>
    	</div>
    </div>
    <?php get_footer(); ?>

    My mp_product.php:

    <?php get_header(); ?>
    
    <div id="page" class="clearfix">
    	<div id="content" class="page-left clearfix">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<h1><?php the_title(); ?></h1>
    		<?php the_content(__('Read more', 'organizedthemes'));?>
    		<?php endwhile; else: ?>
    		<p><?php _e('Sorry, no posts matched your criteria.', 'organizedthemes'); ?></p><?php endif; ?>
    		<?php include(TEMPLATEPATH."/includes/paging.php");?>
    	</div>
    	<div id="sidebar" class="page-right">
    		<?php get_sidebar('product'); ?>
    	</div>
    </div>
    <?php get_footer(); ?>
  • Jonathan
    • The Incredible Code Injector

    Here you go, try this ( haven't tested it in case it breaks - not my fault if it does - lol )

    <?php // custom template for product single view
    get_header();
    ?>
    	<div id="page" class="clearfix">
    	<div id="content" class="page-left clearfix">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1 class="post-title"><?php the_title(); ?></h1>
    				<div class="product-photo"><?php mp_product_image(true, 'single', null); ?></div>
    					<div class="product-details">
    				<div class="content-box">
    					<?php the_content(); ?>
    				</div>
    				<?php echo framemarket_product_meta(); ?>
    			</div>
    				<?php endwhile; else: ?>
    					<p><?php _e( 'Sorry, no posts matched your criteria.', TEMPLATE_DOMAIN ) ?></p>
    				<?php endif; ?>
    			<?php include(TEMPLATEPATH."/includes/paging.php");?>
    	</div>
    	<div id="sidebar" class="page-right">
    		<?php get_sidebar('product'); ?>
    	</div>
    </div>
    <?php get_footer() ?>

    Hard to check <div> on a forum - hope they are all closed

    But in case you missed it - Try downloading gridmarket theme and working off of that - it has almost everything you are wanting to do. It'll get you halfway there at least.

    You are missing these two...
    mp_product_image - the cool looking product image
    framemarket_product_meta - all the other cool stuff

  • Chris
    • The Bug Hunter

    Well, I got there in the end using the code from the template-functions.php -

    <?php // custom template for product single view
    get_header();
    ?>
    	<div id="page" class="clearfix">
    	<div id="content" class="page-left clearfix">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1 class="post-title"><?php the_title(); ?></h1>
    				<div class="product-photo"><?php mp_product_image(true, 'single', null); ?></div>
    					<div class="product-details">
    				<div class="content-box">
    					<?php the_content(); ?>
    				</div>
                    <div class="mp_product_meta">
       					<?php echo mp_product_price(true);
        	        	echo mp_buy_button(false, 'single'); ?>
       				</div> 
    
                    <?php mp_category_list($post->ID, '<div class="mp_product_categories">' . __( 'Categorised in ', 'mp' ), ', ', '</div>'); ?>
                    </div>
    				<?php endwhile; else: ?>
    					<p><?php _e( 'Sorry, no posts matched your criteria.', TEMPLATE_DOMAIN ) ?></p>
    				<?php endif; ?>
    			<?php include(TEMPLATEPATH."/includes/paging.php");?>
    	</div>
    	<div id="sidebar" class="page-right">
    		<?php get_sidebar('product'); ?>
    	</div>
    </div>
    <?php get_footer() ?>
  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    As we haven't heard back from you we're going to assume the problem
    was sorted out and mark this ticket as resolved.

    If it wasn't resolved, or you have any more questions related to this
    thread please feel free to post them below and tick the 'Mark as Not
    Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, thanks for using the forums, and for being a member of WPMU
    DEV, it's a pleasure to help you out and we look forward to being of
    assistance in the future.

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.