Last active
August 11, 2023 05:58
-
-
Save liranop/c068c0b84343f0743f8700c30fa44cd9 to your computer and use it in GitHub Desktop.
Make shipping row in woocommerce cart and checkout to full width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @snippet Expend WooCommerce Shipping Row in Cart and Checkout | |
*/ | |
add_action( 'wp_footer', 'expend_shipping_row_jscript', 9999 ); | |
function expend_shipping_row_jscript() { | |
if ( is_cart() || is_checkout() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$('table.shop_table tr.shipping > td ').attr('colspan',2); | |
$( 'body' ).on( 'updated_checkout', function() { | |
$('table.shop_table tr.shipping > td ').attr('colspan',2); | |
}); | |
}); | |
</script> | |
<?php } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tr.shipping th { | |
display:none | |
} | |
tr.shipping td:before { | |
content: attr(data-title); | |
font-weight: bold; | |
display: block; | |
margin-bottom: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice. Thanks:)