marketpress bread crumb trail

is there already a shortcode for this so I can only show the breadcrumb trail on my store pages?

or should I implement it globally in my theme?

or do I have to use this:

Store Navigation List [mp_store_navigation] – Displays a list of links to your store pages.

and try and get it to look like a breadcrumb trail? (haven’t checked this one out yet)

  • Ovidiu
    • Code Wrangler

    I was thinking of something like this:

    if I click on a product and am viewing the single-product view, I’d like to have a breadcrumb like:

    home => shop => product category => product name

    bread crumb so people can then click to go back to the store or click to view other product from the same category.

    can this be done with marketpress functions or maybe even with built-in wordpress functions, I mean after all marketpress is built upon custom post types…

    I tried using the built–in bread-crumb trail that comes with my theme but it kinda looked like this:

    home => shop => product name

    so I guess I’ll tinker with that and see if I can insert the category in there :slight_smile:

  • Ovidiu
    • Code Wrangler

    partially solved via the custom theme I am using. there is only one problem: the “virtual” pages marketpress creates underneath the “store base” which is a real page are hard to integrate.

    you can see my current test live here: http://www.premaman.co.za/shop/ click on a product, then check the breadcrumb trail. looks nice and even contains the categories, all of them. but go to http://www.premaman.co.za/shop/products/ and it ends there since I don’t have any body classes to target this with and make breadcrumbs visible.

    hm, that gets me thinking, I might need to add a special class to the body to show the parent slug? but will that even work with a “virtual” page?

    any hints or help?

  • Timothy
    • Chief Pigeon

    I’m presuming on the product page its getting the pagination contents from the loop?

    Could you not take that and include it in the archive.php page or better yet in the theme create your own custom post type archive page (for MP).

    archive-product.php

    Then you could totally make that custom and not affect your normal archive page.

    You would basically copy the contents of the default archive page over and then make the appropriate edits with the pagination in there.

    Take care.

  • Timothy
    • Chief Pigeon

    :slight_smile:

    Ok so your theme when viewing a product or the shop page (which is a real page) it will use the default page.php file. Thats how the current pagination is working, right?

    So look at how the page.php of the theme works, extracting the relevant pagination parts.

    Then create yourself a custom archive page as mentioned above or use the existing archives page, although this will affect every archive page on your site then. Add the relavant pagination code which is from the page.php file.

    Does that clarify further?

    Let me know.

  • Ovidiu
    • Code Wrangler

    to be completely honest, I still don’t get it. feel a little bit dense today

    feels like you really need to spell it out for me today :slight_frown:

    Then create yourself a custom archive page as mentioned above or use the existing archives page, although this will affect every archive page on your site then. Add the relavant pagination code which is from the page.php file.

    So yes, I get that, I create a custom archives page, insert my pagination, then what?

    I mean Marketpress still uses the shop page and the virtually created ones…

    so where and when does my custom archive page come into play?

  • Timothy
    • Chief Pigeon

    Hey again.

    to be completely honest, I still don’t get it. feel a little bit dense today

    feels like you really need to spell it out for me today :slight_frown:

    Thats OK, I feel like that most days, lol.

    So yes, I get that, I create a custom archives page, insert my pagination, then what?

    I mean Marketpress still uses the shop page and the virtually created ones…

    so where and when does my custom archive page come into play?

    Well I’ve been playing this morning with MP and themes. If you wanted to make a custom file in your themes folder for product pages then use this one:

    mp_productlist.php

    You could include the pagination and the code required to display your products and the pagination. MarketPress will pick up on the use of that file and use it for the Product Lists.

    It doesn’t use the archive page, it just goes through the WP page within the theme. Which I think you referred to here:

    I mean Marketpress still uses the shop page and the virtually created ones…

    Take care.

  • Ovidiu
    • Code Wrangler

    thanks Timothy. I think I am getting there.

    What I tried so far is to create a mp_productlist.php based on my default page template.

    I then proceeded to delete everything within the “content” part and replaced it with the content that is being used in the FrameMarket Theme inside mp_productlist.php

    <?php if ( class_exists( 'MarketPress' ) ) {
    ?>
    <h1 class="post-title"><?php _e( 'Our products', 'framemarket' ) ?></h1>
    <div id="mp-product-grid">
    <?php framemarket_grid_mp_list_products();?>
    <div class="clear"></div>
    </div>
    <?php
    }
    ?>

    But that doesn’t bring up any content :slight_frown: – what are you using in your mp_productlist.php?

    Besides, I am sure this will not yield any results. You see, creating this custom page template only allows me to style my Product Page, ultimately, if one is viewing a single product, the breadcrumb trail isn’t being picked up properly because WordPress only knows about the SHOP page, the Single Product page and the categories view. So it will never pick up on the virtual pages created by MarketPress.

    I stand to be corrected.

  • Timothy
    • Chief Pigeon

    Besides, I am sure this will not yield any results. You see, creating this custom page template only allows me to style my Product Page, ultimately, if one is viewing a single product, the breadcrumb trail isn’t being picked up properly because WordPress only knows about the SHOP page, the Single Product page and the categories view. So it will never pick up on the virtual pages created by MarketPress.

    I stand to be corrected.

    Maybe I misread :-s

    I thought:

    http://www.premaman.co.za/shop/products/polly-black-magic-high-chair/

    For single products was fine like that, but now you want that also on the product list page?

    If thats correct, then its only the list you need to alter no? Or do I not fully understand?

    Before going to much further just wanna make sure I’m not having a dumb moment, I get em often. lol

    Thanks.

  • Ovidiu
    • Code Wrangler

    no worries, its usually me who is not explainig himself properly.

    I’ll try and be a lot mroe clearer this time, but keep in mind, everthign I will state now has a question mark behind it so correct me if I am wrong.

    also read this post, it is related: https://premium.wpmudev.org/forums/topic/is-marketpress-declaring-custom-post-types-wrong

    I would like to include breadcrumb trails with the full path.

    lets keep this example: http://www.premaman.co.za/shop/products/polly-black-magic-high-chair/

    see it is omitting “products” from the breadcrumb trail?

    as far as I understand the situation, whatever function or plugin you use for breadcrumb trails will create them based upon the structure and upon how the custom post types and custom taxonomies have been declared, i.e. are they hierarchical, is rewrite slug used, etc. This I gathered from trolling the WordPress Codex – so how do I get “Products” included in my breadcrumb trail?

  • Ovidiu
    • Code Wrangler

    but there isn’t any body class so I can properly target only a specific one of these virtual pages, say the products page, is there?

    when you say template files do you mean as used in i.e. the framemarket theme?

    I looked at the mp_productlist.php the code used there is

    ‘<?php // custom template for product list

    get_header();

    ?>

    <div id=”content”>

    <?php if ( class_exists( ‘MarketPress’ ) ) {

    ?>

    <h1 class=”post-title”><?php _e( ‘Our products’, ‘framemarket’ ) ?></h1>

    <div id=”mp-product-grid”>

    <?php framemarket_grid_mp_list_products();?>

    <div class=”clear”></div>

    </div>

    <?php

    }

    ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>’

    that won’t help much. anyway, I’ll figure it out.somehow.

  • immeemz
    • WPMU DEV Initiate

    Hey, I was having this exact problem and I was able to find a way to apply body classes to Marketpress only by using the “Add URL Slugs as Body Classes” plugin. Worked like a charm!

    I agree customizing Marketpress is needlessly complicated.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.