Display order of items on the checkout page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #918867
    Ryan Labelle
    Participant

    Hi. I created a post but I think it was removed? I’m reposting this..

    I would like to change the display order of some parts of the checkout form.

    For example, we would like to put the price breakdown under the number of guests.

    Image 2020-02-14 at 12.49.13 PM

    It believe that this is coming from:
    wp-content/plugins/motopress-hotel-booking/includes/shortcodes/checkout-shortcode/step-checkout.php

    and I’ve tried to use the templating system to override in the child theme but it’s not working for me. I guess this only works for files under /templates?

    Is there a way to do this?

    I’m handy with WP / php but I was wondering if you could point me in the right direction.

    Thank you.

    #929270
    Mary Evans
    Participant

    Hi Ryan,

    It is not possible to override the plugin safely for further updates and move the price breakdown inside of that blocks you captured on the screenshot. We can move it to be before Booking Details http://prntscr.com/reay7d or after that block and before the coupon field http://prntscr.com/reazar

    Best Regards,
    M. Evans

    #1666171
    Oscar Kommeren
    Participant

    Hi,

    Is it still impossible to change the order of different elements of the checkout page?

    Kind regards
    Oscar

    #1667725
    J. Davis
    Keymaster

    Hi Oscar,

    All the sections of the checkout page can be found at \motopress-hotel-booking\includes\shortcodes\checkout-shortcode\step-checkout.php
    Every section has its priority at the end of the line. You should remove the action and add it with a new priority.
    Here is an example of how to move the “coupon” section to the very bottom (priority was 20 became 45):
    add_action(‘wp_head’,’remove_render_Coupon’);

    function remove_render_Coupon(){
    remove_action( 'mphb_sc_checkout_form', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCoupon' ), 20 );
    }
    add_action( 'mphb_sc_checkout_form', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCoupon' ), 45 );

    This code can be added to the functions.php file of your Theme or by using a Code Snippets plugin.

    #1669202
    Oscar Kommeren
    Participant

    Hello J Davis,

    Thanks for you response I will try using this.
    Can this also be used to put certain elements in a left or right column?

    Kind regards
    Oscar

    #1674660
    J. Davis
    Keymaster

    Hi Oscar, You will need to apply the custom CSS styles to change the alignment of sections.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.