Where is a fully functioning version of the mp_product.php that can be modified?

We would like to override the behaviour of the product detail page. We understand that we do this by dropping in a file called "mp_product.php". We can do this and it works. Unfortunately we have no idea what is meant to be in one of these files to implement all of the basic functionality, such as price, quantity etc.

Where can we get a fully functioning version of this file, and all the other files that define the behaviour of the store?

Thank you for your help,

  • DavidM

    Hi Frances and first off, welcome to WPMU DEV!

    Those files you're referring to, the MarketPress template files outlined in marketpress\marketpress-includes\themes\Themeing_MarketPress.txt are simply template files, just like WordPress template files as detailed here:

    Given that, MarketPress templates would correspond to those files for the most part. Your theme, when developed according to WordPress theme standards, should have a single.php file. You can make a copy of that and name it mp_product.php. You can customize it with any of the MarketPress template functions from there.

    Similarly, the mp_category.php would could be a copy of your theme's category.php file.

    If any of those files exist in your theme folder, MarketPress will use them. If not, MarketPress will use your standard theme files.

    As such, there's no standard mp_product.php file. It would be dependent on your theme.

    Does that help?


  • francesborkman

    Yes, I understand that that is the process. I have copied the single.php file, renamed it mp_product.php, and it does actually "work". Unfortunately, it implements almost none of the functionality that we need, so I will need to include those functions that you refer to. For example, there is no input field for ordering some quantity of the product. All I have is a display of the product photo and description.

    This is getting rather beyond the level of coding that I was hoping to use... I was hoping that there was a vanilla mp_product.php file somewhere in the world that implements all of the features, that I could modify, rather than having to build up the complete functionality from scratch myself based solely on the technical documentation. A fully worked-out example, if you prefer, to work from rather than just the documented API.


  • pro120

    There quantity field is handled by each individual store's settings under the presentation tab.

    How you should approach your theme is really going to depend on how much your changing the default usage of certain marketpress functions like mp_buy_button() etc. If you are wanting to edit the button itself from, lets say an input to an a tag you would have to override or change the template_functions.php file which I do not recommend doing. If you want to change the location of a buy button for instance you should look inside the template_functions.php file to see what functions you can use like mp_buy_button() and others. I'm afraid you might still feel lost with either route but I would suggest looking at the gridmarket theme or others and look for the functions that handle the store display and you will start to see how you could incorporate different methods into your theme.

  • francesborkman

    Okay, I have successfully coped and enhanced the theme's single.php to create mp_product.php. Now I need to create mp_category.php so I can tweak that behaviour. Unfortunately, there is no category.php file in the theme. There is page-blog.php, which is almost the right thing, but it show ALL posts/products. not just the ones for a particular category. Is there somewhere else I should be looking for a template to turn into mp_category.php?

    THanks for all your help,

  • Mason


    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.


  • Grafics

    Per guidance here and in other threads, I tried copying page.php to mp_productlist.php. With default page.php everything works fine, other than layout customizations. With exact same code is copied into productlist.php everything is a mess, sidebar is below products, etc.
    I have managed to get a working mp_category.php using mp_product_list borrowed/altered from Framemarket, however paging doesn't work.
    Really stuck here and well past deadline. Any ideas where I'm going wrong?