marketpress custom template pages

Are their any examples of custom template pages (mp_cart.php or mp_category.php) available anywhere?

  • tobeyebot

    Hey Jack, and thanks for the reply. I dug through the mp_cart.php provided by the free theme at said site and took a decent stab at it. However, when I select the checkout option the button doesn't function. Is there any way you can discern what the complication is? The culprit can be found here at the moment: http://pbgear4less.com/store/shopping-cart/

    As far as the second reference, the only thing I could find that related was this simple listing and nothing else:
    Store Page – mp_store.php
    Cart/Checkout Page – mp_cart.php
    Order Status Page – mp_orderstatus.php
    Product List Page – mp_productlist.php

    Is there a useable mp_cart.php template file available in one of the paid themes you all offer?

  • tobeyebot

    I'm going to remove the current custom template page attempt and post the code below, so that link I supplied above shouldn't be referenced anymore.

    Here's what I have in my attempted mp_cart.php custom template page.

    <?php get_header('category'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="row-fluid prod_list">
    	<div class="container">
    	  <div class="span12">
    	  <div class="item-section-divider"><h3>Your Shopping Cart</h3></div>
    	  </div>
    	</div>
    </div>
    <div class="row-fluid prod_list">
    	<div class="container">
    	  <div class="span8 offset2">
    	  	<?php mp_show_cart(); ?>
    
    	<?php endwhile; else: ?>
    		<p><?php _e('Sorry, this page does not exist.'); ?></p>
    	<?php endif; ?>
    	  </div>
      </div>
    </div>
    
    <?php get_footer(); ?>
  • tobeyebot

    Hey Jack. No problem.

    I've got a temporary page set up on a different site that can be used for reference.

    http://madeby.info/bump/store/shopping-cart/

    Additionally, can you potentially show me what it would look like to actually insert a good deal of the actual cart template functions into the page? I'm assuming this would happen in place of <?php mp_show_cart(); ?> but not sure how that actually breaks down.

    Thanks

  • Jack Kitterhing

    Hi there @tobeyebot,

    Hope you're well today, the mp_show_cart function breaks down into

    function mp_show_cart($context = '', $checkoutstep = null, $echo = true) {
    		global $mp, $blog_id;
    		$content = '';
    
    		if ($checkoutstep == null)
    				$checkoutstep = get_query_var('checkoutstep');
    
    		if (mp_items_in_cart() || $checkoutstep == 'confirmation') {
    
    				if ($context == 'widget') {
    						$content .= _mp_cart_table('widget');
    						$content .= '<div class="mp_cart_actions_widget">';
    						$content .= '<a class="mp_empty_cart" href="' . mp_cart_link(false, true) . '?empty-cart=1" title="' . __('Empty your shopping cart', 'mp') . '">' . __('Empty Cart', 'mp') . '</a>';
    						$content .= '<a class="mp_checkout_link" href="' . mp_cart_link(false, true) . '" title="' . __('Go To Checkout Page', 'mp') . '">' . __('Checkout &raquo;', 'mp') . '</a>';
    						$content .= '</div>';
    				} else if ($context == 'checkout') {
    
    					if ($mp->get_setting('show_purchase_breadcrumbs') == 1) {
    							$content .= mp_cart_breadcrumbs($checkoutstep);
    					}
    
    					//generic error message context for plugins to hook into
    					$content .= apply_filters('mp_checkout_error_checkout', '');

    Which is within template-functions.php on line 1044 :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • tobeyebot

    Ah, got it, thanks. So, if I add that bit to my template page per the following I get all sorts of errors.

    <?php function mp_show_cart($context = '', $checkoutstep = null, $echo = true) {
    		global $mp, $blog_id;
    		$content = '';
    
    		if ($checkoutstep == null)
    				$checkoutstep = get_query_var('checkoutstep');
    
    		if (mp_items_in_cart() || $checkoutstep == 'confirmation') {
    
    				if ($context == 'widget') {
    						$content .= _mp_cart_table('widget');
    						$content .= '<div class="mp_cart_actions_widget">';
    						$content .= '<a class="mp_empty_cart" href="' . mp_cart_link(false, true) . '?empty-cart=1" title="' . __('Empty your shopping cart', 'mp') . '">' . __('Empty Cart', 'mp') . '</a>';
    						$content .= '<a class="mp_checkout_link" href="' . mp_cart_link(false, true) . '" title="' . __('Go To Checkout Page', 'mp') . '">' . __('Checkout &raquo;', 'mp') . '</a>';
    						$content .= '</div>';
    				} else if ($context == 'checkout') {
    
    					if ($mp->get_setting('show_purchase_breadcrumbs') == 1) {
    							$content .= mp_cart_breadcrumbs($checkoutstep);
    					}
    
    					//generic error message context for plugins to hook into
    					$content .= apply_filters('mp_checkout_error_checkout', ''); ?>

    Because I can't find an example of how to actually work out the function in a template page I've been editing the actual template-functions.php until I can clarify how it works.

    Thanks.

  • Hoang Ngo

    Hi @tobeyebot,

    How are you today ?

    About your site,i see that it has stucked at the checkout step.
    Can you please check this for me.
    I assume that you will use paypal express for the gateway.
    So please login to the Backend => Products => Store Settings => Payments and chose the Paypal Express Checkout (You can change it later to fit for your need)

    And then click Save Changes.

    After that save,you will see the gateway config.Fill your info and click save again.

    Now in the frontend,the Checkout will be active.

    If you have any issue please tell us so we can assist you.

    Best Regards
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.