How to add a second ‘place order’ button in WooCommerce

My client would like two ‘Place order’ buttons on his checkout page (http://www.jobgrandprix.fr/checkout/?set-cart-qty_2652=1).

By default, the ‘Commander’ (his site is in French) button is at the bottom of the page. I’m trying to add a second one in the right hand column at the top of the page.

Read More

I think form-checkout.php is what I need to modify. I think I need to add it where the shipping column usually is (not used here because it is a virtual product).

If anyone has any pointers I’d be really grateful.

Thanks.

Related posts

Leave a Reply

1 comment

  1. Place Order Button can’t go out of the <form></form> element. What you can do is you can duplicate the button within the element but at the top. like this:

    enter image description here

    For this:

    Withing you child theme make a folder woocommerce and inside that checkout.

    Now go to wp-contentpluginswoocommercetemplatescheckout and copy form-checkout.php file and paste that into MY_CHILD_THEMEwoocommercecheckout folder and edit it.

    WHY ABOVE STEP?
    So that you won’t edit the core woocommerce files and the update will be lost when this plugin updates in future. The above structure overrides the core template file.

    OK NOW EDIT form-checkout.php

    Below

    <form name="checkout" method="post" class="checkout" action="<?php echo esc_url( $get_checkout_url ); ?>">

    Add the Button Code and it should look like this.

    <form name="checkout" method="post" class="checkout"
    action="<?php echo esc_url( $get_checkout_url ); ?>">
    
    <div class="form-row place-order">
    
      <noscript>Since your browser does not support JavaScript, or it is disabled,
        please ensure you click the &amp;lt;em&amp;gt;Update Totals&amp;lt;/em&amp;gt;
        button before placing your order. You may be charged more than the amount
        stated above if you fail to do so.&amp;lt;br/&amp;gt;&amp;lt;input type="submit"
        class="button alt" name="woocommerce_checkout_update_totals"
        value="Update totals" /&amp;gt;</noscript>
    
        <input
        type="hidden" id="_wpnonce" name="_wpnonce"
        value="c82a4af261"><input type="hidden" name="_wp_http_referer"
        value="/woocommerce2/wp-admin/admin-ajax.php" />
    
        <input
        type="submit" class="button alt" name="woocommerce_checkout_place_order"
        id="place_order" value="Place order" data-value="Place order" />
    
      </div>
    
      <?php if ( sizeof( $checkout->checkout_fields ) > 0 ) : ?>
    

    Save it and Bingo. You can do some CSS and align the button to the right side of the form element. But remember it can’t go out of <form></form> element.