This file contains 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
.woocommerce-checkout .storefront-primary-navigation, | |
.woocommerce-checkout .site-search, | |
.woocommerce-checkout .header-widget-region, | |
.woocommerce-checkout .footer-widgets { | |
display: none; | |
} |
This file contains 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
<?php | |
// Filter the checkout fields | |
add_filter( 'woocommerce_checkout_fields', 'patricks_woocommerce_checkout_fields' ); | |
// add a "how did you hear about us" field - $fields is passed via the filter | |
function patricks_woocommerce_checkout_fields( $fields ) { | |
// add the field | |
$fields['order']['hear_about_us'] = array( | |
'type' => 'select', | |
'class' => array( 'form-row-wide' ), |
This file contains 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
<?php | |
// Filter the checkout fields | |
add_filter( 'woocommerce_checkout_fields', 'patricks_woocommerce_checkout_fields' ); | |
// Remove the billing phone - $fields is passed via the filter | |
function patricks_woocommerce_checkout_fields( $fields ) { | |
// remove the phone field | |
unset($fields['billing']['billing_phone']); | |
// make the billing email field fill up the entire space |
This file contains 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
<?php | |
// check for empty-cart get param to clear the cart | |
add_action( 'init', 'woocommerce_clear_cart_url' ); | |
function woocommerce_clear_cart_url() { | |
global $woocommerce; | |
if ( isset( $_GET['empty-cart'] ) ) { | |
$woocommerce->cart->empty_cart(); | |
} | |
} |
This file contains 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
<?php | |
function patricks_woocommerce_catalog_orderby( $orderby ) { | |
// Add "Sort by date: oldest to newest" to the menu | |
// We still need to add the functionality that actually does the sorting | |
$orderby['oldest_to_recent'] = __( 'Sort by date: oldest to newest', 'woocommerce' ); | |
// Change the default "Sort by newness" to "Sort by date: newest to oldest" | |
$orderby["date"] = __('Sort by date: newest to oldest', 'woocommerce'); | |
// Remove price & price-desc |
This file contains 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
<?php | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
This file contains 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
<?php | |
// Add "Sort by date: oldest to newest" to the menu | |
// We still need to add the functionality that actually does the sorting | |
// Original credit to Remi Corson: http://www.remicorson.com/woocommerce-sort-products-from-oldest-to-most-recent/ | |
function patricks_woocommerce_catalog_orderby( $sortby ) { | |
$sortby['oldest_to_recent'] = __( 'Sort by date: oldest to newest', 'woocommerce' ); | |
return $sortby; | |
} | |
add_filter( 'woocommerce_catalog_orderby', 'patricks_woocommerce_catalog_orderby', 20 ); |
This file contains 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
<?php | |
// Modify the default WooCommerce orderby dropdown | |
// | |
// Options: menu_order, popularity, rating, date, price, price-desc | |
// In this example I'm changing the default "Sort by newness" to "Sort by date: newest to oldest" | |
function patricks_woocommerce_catalog_orderby( $orderby ) { | |
$orderby["date"] = __('Sort by date: newest to oldest', 'woocommerce'); | |
return $orderby; | |
} | |
add_filter( "woocommerce_catalog_orderby", "patricks_woocommerce_catalog_orderby", 20 ); |
This file contains 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
<?php | |
add_filter( 'woocommerce_cart_needs_shipping', '__return_true' ); |
This file contains 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
.single_add_to_cart_button.fa:before { | |
padding-right: 10px; | |
} |