[MarketPress eCommerce] Appointments Plus / MartketPress / Mijireh

Hello
I am using appointments plus with marketpress in order to allow me to take payments through the system using Mijireh
I have 1 page which uses Services drop down to allow the customer to select the appointment etc.

This is all working and when i check out the customer is taken off to mijireh for payment, however the cart in mijireh is showing the name of the page where appointments are booked plus the appointment ID - eg Spa Day Offer: 119
How can i change this so that the mijireh payment gateway shows the name of the service and the details of the appointment as opposed to the ID of the appointment. I have looked in the code for the gateway and written some code to lookup the appointment details which i have tested, however i cant find where i need to change the code for the payment gateway so this data is passed to mijireh instead of the data as mentioned above. Any guidance on where to look in the code would be very helpful
Thanks in Advance.

  • Nithin
    • Support Wizard

    Hi Nigel,

    This is all working and when i check out the customer is taken off to mijireh for payment, however the cart in mijireh is showing the name of the page where appointments are booked plus the appointment ID - eg Spa Day Offer: 119

    I tried to checkout a test product, to see how it works in your system, but I'm getting the following error:

    Seems like you are working on your site. Just to be sure the issue occurs once the Mijireh payment page is loaded, right?

    Because, I checked the default pages in WordPress side, that's for example:

    /store/products/spa-treatment/

    And the cart page, was listing out the name as follows, which seems to be fine.

    I'm bringing this into our developers attention to see whether there is any workaround, that could be done within the plugin side to help get this sorted in the Mijireh checkout page.

    Will keep you updated once I get further feedback from the developer asap. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Nigel
    • New Recruit

    I am sure there is a better way, i managed to solve this by editing get_data in the file "item.php" in the mijireh folder under payment gateways in the marketpress plugin.

    Now i just need the mini cart to reflect these same changes.

    Thanks again for your assistance.

  • Nithin
    • Support Wizard

    Hi Nigel,

    Glad to hear that you figured out the 1st query. To change how it's listed in cart, could you please test, and see how the following code goes:

    <?php
    add_filter( 'mp_product/title', 'mp_product_title', 9999, 2 );
    function mp_product_title( $title, MP_Product $product ) {
    	if ( $product->is_variation() ) {
    		//some case product post will fail
    		$post = get_post($product->ID);
    		$parent = get_post( $post->post_parent );
    		if ( strpos( $parent->post_content, '[app_' ) !== false ) {
    			//this is app variant
    			return $post->post_title;
    		}
    	}
    
    	return $title;
    }

    The above code will only return the Product name in the cart, you can implement the code as a mu-plugins, please check this article on using mu-plugins:
    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.