Skip to content

Instantly share code, notes, and snippets.

@rodica-andronache
Last active January 29, 2016 09:20
Show Gist options
  • Save rodica-andronache/348e513769d318e23e82 to your computer and use it in GitHub Desktop.
Save rodica-andronache/348e513769d318e23e82 to your computer and use it in GitHub Desktop.
WooCommerce tricks
-> Remove formularul pentru cupon pe pagina de checkout:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 )
-> Remove login form de pe pagina de checkout:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 );
-> Move coupon code form on checkout page, after the "Your order" table:
function coupon_after_order_table_js() {
wc_enqueue_js( '
$( $( ".woocommerce-info, .checkout_coupon" ).detach() ).appendTo( "#shop-isle-checkout-coupon" );
');
}
add_action( 'woocommerce_before_checkout_form', 'coupon_after_order_table_js' );
function shop_isle_coupon_after_order_table() {
echo '<div id="shop-isle-checkout-coupon"></div><div style="clear:both"></div>';
}
add_action( 'woocommerce_checkout_order_review', 'shop_isle_coupon_after_order_table' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment