move proceed to checkout button. closes #5496

This commit is contained in:
James Koster 2014-10-06 12:33:36 +01:00
parent 90297a09af
commit ef28c43862
8 changed files with 46 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -217,7 +217,6 @@
.cart_totals { .cart_totals {
float: right; float: right;
width: 48%; width: 48%;
text-align: right;
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -1192,6 +1192,17 @@ p.demo_store {
} }
} }
.wc-proceed-to-checkout {
@include clearfix;
padding: 1em 0;
a.checkout-button {
display: block;
text-align: center;
margin-bottom: 1em;
}
}
/* =Cart Sidebar /* =Cart Sidebar
-------------------------------------------------------------- */ -------------------------------------------------------------- */
@ -1319,9 +1330,6 @@ p.demo_store {
tr td, tr th { tr td, tr th {
border-top: 1px solid $secondary; border-top: 1px solid $secondary;
} }
a.button.alt {
display: inline-block;
}
} }
.cross-sells { .cross-sells {
ul.products { ul.products {

View File

@ -1203,6 +1203,26 @@ if ( ! function_exists( 'woocommerce_cross_sell_display' ) ) {
} }
} }
if ( ! function_exists( 'woocommerce_button_proceed_to_checkout' ) ) {
/**
* Output the proceed to checkout button.
*
* @access public
* @subpackage Cart
* @return void
*/
function woocommerce_button_proceed_to_checkout() {
$checkout_url = WC()->cart->get_checkout_url();
?>
<a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php _e( 'Proceed to Checkout', 'woocommerce' ); ?></a>
<?php
}
}
/** Mini-Cart *************************************************************/ /** Mini-Cart *************************************************************/
if ( ! function_exists( 'woocommerce_mini_cart' ) ) { if ( ! function_exists( 'woocommerce_mini_cart' ) ) {

View File

@ -177,8 +177,10 @@ add_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10
* Cart * Cart
* *
* @see woocommerce_cross_sell_display() * @see woocommerce_cross_sell_display()
* @see woocommerce_button_proceed_to_checkout()
*/ */
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 10 );
/** /**
* Footer * Footer

View File

@ -4,7 +4,7 @@
* *
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 2.1.0 * @version 2.3.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -83,6 +83,12 @@ if ( ! defined( 'ABSPATH' ) ) {
</table> </table>
<div class="wc-proceed-to-checkout">
<?php do_action( 'woocommerce_proceed_to_checkout' ); ?>
</div>
<?php if ( WC()->cart->get_cart_tax() ) : ?> <?php if ( WC()->cart->get_cart_tax() ) : ?>
<p><small><?php <p><small><?php

View File

@ -4,7 +4,7 @@
* *
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 2.1.0 * @version 2.3.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -118,14 +118,14 @@ do_action( 'woocommerce_before_cart' ); ?>
<label for="coupon_code"><?php _e( 'Coupon', 'woocommerce' ); ?>:</label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php _e( 'Coupon code', 'woocommerce' ); ?>" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e( 'Apply Coupon', 'woocommerce' ); ?>" /> <label for="coupon_code"><?php _e( 'Coupon', 'woocommerce' ); ?>:</label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php _e( 'Coupon code', 'woocommerce' ); ?>" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e( 'Apply Coupon', 'woocommerce' ); ?>" />
<?php do_action('woocommerce_cart_coupon'); ?> <?php do_action( 'woocommerce_cart_coupon' ); ?>
</div> </div>
<?php } ?> <?php } ?>
<input type="submit" class="button" name="update_cart" value="<?php _e( 'Update Cart', 'woocommerce' ); ?>" /> <input type="submit" class="checkout-button button alt wc-forward" name="proceed" value="<?php _e( 'Proceed to Checkout', 'woocommerce' ); ?>" /> <input type="submit" class="button" name="update_cart" value="<?php _e( 'Update Cart', 'woocommerce' ); ?>" />
<?php do_action( 'woocommerce_proceed_to_checkout' ); ?> <?php do_action( 'woocommerce_cart_actions' ); ?>
<?php wp_nonce_field( 'woocommerce-cart' ); ?> <?php wp_nonce_field( 'woocommerce-cart' ); ?>
</td> </td>