MarketPress: add "Continue Shopping" and "Review Order" buttons on single page

It would be ideal to have the "Continue Shopping" and "Review Order" buttons that are in the cart ... Is there any way to create these on the individual product pages, even if I have to drop it into each product? Like a shortcode? Or any other workaround?

  • Nahid

    Hey Laurel !
    Hope you are having a great day!

    You can try adding the following code in a mu-plugin:

    <?php
    function mp_cus_continue_shopping_shortcode() {
    	return '<a href="' . mp_products_link( false, true ) . '" class="mp_button mp_button-continue-shopping mp_button-large">Continue Shopping?</a>';
    }
    add_shortcode('mp_continue_shopping_btn', 'mp_cus_continue_shopping_shortcode');
    
    function mp_cus_review_order_shortcode() {
    	return '<a href="' . mp_cart_link( false, true ) . '" class="mp_button mp_button-continue-shopping mp_button-large">Review Order</a>';
    }
    add_shortcode('mp_review_order_btn', 'mp_cus_review_order_shortcode');

    A mu-plugin is just a PHP file with any name, e.g. anyname.php (I'd recommend having a meaningful name for future reference, the file should have a .php extension). This file has to be located in {your WordPress folder}/wp-content/mu-plugins (you'll have to create a 'mu-plugins' folder if there isn't one already). You can know more about mu-plugins here.

    Alternatively, you can also add the code in the functions.php file of your theme (more preferably child theme). In this case, please remove the first line containing the "<?php" starting tag.

    While the code is added, you can use the [mp_continue_shopping_btn] shortcode for displaying the "Continue Shopping" button which'll direct to the MarketPress products page and you can use the [mp_review_order_btn] shortcode for displaying the "Review Order" button which'll direct to the MarketPress cart page.

    Hope this helps. Let me know if you need any further assistance regarding this. Thanks!

    Best,
    Nahid