krex
krex

Reputation: 77

How to move Proceed to checkout - cart woocommerce

I want to move Proceed to checkout button to the bottom of the cart page. I moved

<input type="submit" class="checkout-button button alt" name="proceed" value="<?php _e(  'Proceed to Checkout &rarr;', 'woocommerce' ); ?>" />
<?php do_action('woocommerce_proceed_to_checkout'); ?>

To the bottom to the page, the button displays but it doesn't work. I've searched for the hook woocommerce_proceed_to_checkout, but I didn't find it.

Upvotes: 1

Views: 5149

Answers (2)

user3607351
user3607351

Reputation: 13

Make sure your code is inside the form tag ( code here ).

You do not need to do a lot of work, just cut the end of form tag, which is and place this at the end.

Upvotes: 0

grimasa
grimasa

Reputation: 128

A little bit late, but I can't help myself. inputs should be inside form tags. Otherwise the data couldn't be handled (post method). Try this code:

<form action="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" method="post">
  <input type="submit" class="checkout-button button alt wc-forward" name="proceed" value="<?php _e( 'Proceed to Checkout', 'woocommerce' ); ?>" />
  <?php do_action( 'woocommerce_proceed_to_checkout' ); ?>
  <?php wp_nonce_field( 'woocommerce-cart' ); ?>
</form>

Upvotes: 2

Related Questions