Marketpress template help

Can someone point me in the direction of some info on how to create template pages for marketpress and also how to update and change pages such as the 'store' or 'marketplace' pages and how these fit in with the shortcodes..

Thanx :slight_smile:

  • DavidM

    Hi Byronmarkets,

    Sure thing! There's a file in the MarketPress folder, \marketpress\marketpress-includes\themes\Themeing_MarketPress.txt, which goes through general instructions on that and lists the various template names.

    And basically, you'd just use your theme's respective template files, create copies of them, then rename them accordingly, and make your custom changes there.

    For instance, for single product listings, you'll likely create a copy of your theme's single.php file, rename it mp-product.php, then customize that how you'd like for it to work.

    Shortcodes really wouldn't be used in that case though. You'd instead rely on the same functions that the shortcodes rely on, which are detailed in \marketpress-includes\template-functions.php.

    The functions in that file are very well commented to make things clearer. Just let us know if you have any questions on it all!

    Thanks,
    David

  • shanx24

    This is the code I have in mp_productlist.php:

    <?php get_header(); ?>
    <?php
    // Get the posts
    $myposts = get_posts('numberposts=-1&orderby=title&order=ASC&<strong>category_name=products</strong>');
    ?>
    
    <?php foreach($myposts as $post) : ?>
       <?php setup_postdata($post); ?>
       <a href="<?php echo get_permalink(); ?>">
       <?php the_title() ?></span>
       <?php echo $the_content(); ?>
       </a>
    <?php endforeach; ?>
    
    <?php get_footer(); ?>

    This doesn't work. Firstly, it only shows regular posts, not products. What's the category name of products (I'm presuming MarketPress is using a custom post type and therefore a category?).

  • shanx24

    I discovered the following function in the template-functions.php:

    mp_list_products()

    This function has some hideous HTML code being written inside the function. Clearly, this is hardly customizable. I'm not going to edit code in a function to change the look and feel of the pages!

    Could someone please point me to how precisely this plugin thinks its users will customize it. How should I access the fields of a product title, product description, and other custom fields?

    Many thanks.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.