There, I am trying to see the scope of one of your plugin

Hello There,

I am trying to see the scope of one of your plugin "MarketPress" in my project.
But I am curious to know if there is any type of conditional functions available for example : is_product() , is_checkout() etc.

Can you please provide me a list of all conditional logics related with the cart and products?

Quick help will be much appreciated.


  • Thomas

    Hello Ashok,

    Thanks for looking into the issue.

    I have already checked this file /wp-content/plugins/marketpress/marketpress-includes/template-functions.php

    But didnt find what I am looking for. Specifically I want the function for the following :

    1) How can I check if its a product details page?
    2) How can I get the total value of cart ?
    3) How can I check if its a category page?
    4) How to get order details on the order conform page(the one coming after payment) and Thank you page ?

    Please let me know how can I achieve these.

  • Ash

    Hello @Thomas

    I hope you are well today.

    1. Try the following code:

    add_filter( 'the_content', 'mp_content' );
    function mp_content($content){
    	if( is_singular( 'product' ) ){
    		// Do whatever you want
    		return $content;

    So the template function is is_singular( 'product' )

    2. About the total cart value, you need to be little tricky. You can use code like the following:

    global $mp;
    $cart = $this->get_cart_cookie(true);

    The $cart will be the array of all items, quantity and prices in the cart, you can grab the amount from this.

    3. Use the following condition:
    is_tax( 'product_category' )

    4. The order details should be in confirmation page, do you see different? Please post a screenshot how it looks like to you.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.