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
<?php | |
/* | |
Plugin Name: Pixel Perfect Webinar Changes | |
Description: The changes for the Pixel Perfect Webinar | |
Version: 1.0.0 | |
Author: Patrick Rauland | |
Author URI: https://speakinginbytes.com | |
*/ | |
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
<?php | |
/* | |
* Plugin Name: Heap Analytics | |
* Plugin URI: https://gist.github.com/BFTrick/bb3b3b0e0497e8adecfa00e3c8e1b33d | |
* Description: Send all site data to Heap Analytics | |
* Author: Patrick Rauland | |
* Author URI: http://speakinginbytes.com | |
* Version: 1.0 | |
*/ |
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
<?php | |
// change the number of products per row | |
add_filter( 'loop_shop_columns', 'patricks_loop_columns', 20 ); | |
function patricks_loop_columns() { | |
return 5; // the number of products per row | |
} | |
// you still need to add CSS to make it look right. In Storefront you can add this to your style.css file. | |
// @media (min-width:768px){ | |
// .products .product { |
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
<?php | |
// Display 25 products per page. Goes in your theme's functions.php | |
// Credit: https://gist.github.com/jameskoster/1601682 | |
add_filter( 'loop_shop_per_page', 'patricks_products_per_page', 20 ); | |
function patricks_products_per_page( $num_products ) { | |
return 20; | |
} |
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
<?php | |
// credit: ChromeOrange - https://gist.github.com/ChromeOrange/10013862 | |
add_filter( 'woocommerce_package_rates' , 'patricks_sort_woocommerce_available_shipping_methods', 10, 2 ); | |
function patricks_sort_woocommerce_available_shipping_methods( $rates, $package ) { | |
// if there are no rates don't do anything | |
if ( ! $rates ) { | |
return; | |
} | |
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
<?php | |
add_filter( 'woocommerce_add_to_cart_redirect', 'patricks_custom_cart_redirect' ); | |
function patricks_custom_cart_redirect() { | |
// our prodcut category ID | |
$product_cat_id = 10; // replace this number with your category ID | |
// redirect to the page | |
return get_term_link( $product_cat_id, 'product_cat' ); | |
} |
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
<?php | |
// credit: WooThemes https://gist.github.com/woogist/6fd2d358bb2e51a25ac5 | |
add_filter( 'woocommerce_add_to_cart_redirect', 'patricks_custom_cart_redirect' ); | |
function patricks_custom_cart_redirect() { | |
return get_permalink( wc_get_page_id( 'shop' ) ); | |
} |
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
.woocommerce-checkout .storefront-primary-navigation, | |
.woocommerce-checkout .site-search, | |
.woocommerce-checkout .header-widget-region, | |
.woocommerce-checkout .footer-widgets { | |
display: none; | |
} |
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
<?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 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
<?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 |