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
add_action( 'woocommerce_share', 'patricks_woocommerce_social_share_icons', 10 ); | |
function patricks_woocommerce_social_share_icons() { | |
if ( function_exists( 'sharing_display' ) ) { | |
remove_filter( 'the_content', 'sharing_display', 19 ); | |
remove_filter( 'the_excerpt', 'sharing_display', 19 ); | |
echo sharing_display(); | |
} | |
} | |
/** http://speakinginbytes.com/2014/12/social-media-icons-woocommerce-products/ **/ |
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
add_filter('woocommerce_enable_order_notes_field', '__return_false'); | |
/** http://stackoverflow.com/questions/22483312/woocommerce-removing-additional-information-name-on-checkout-page **/ |
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
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
function custom_woocommerce_product_add_to_cart_text() { | |
global $product; | |
$product_type = $product->product_type; | |
switch ( $product_type ) { | |
case 'external': | |
return __( 'Take me to their site!', 'woocommerce' ); | |
break; |
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
function rp4wp_title_order_received( $title, $id ) { | |
if ( is_order_received_page() && get_the_ID() === $id ) { | |
global $wp; | |
$order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); | |
$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); | |
if ( $order_id > 0 ) { | |
$order = wc_get_order( $order_id ); | |
if ( $order->order_key != $order_key ) { |
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
/** | |
* Hide shipping rates when free shipping is available. | |
* Updated to support WooCommerce 2.6 Shipping Zones. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { |
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
// Add attributes to checkout fields | |
function wc_add_checkout_add_ons_attributes( $checkout_fields ) { | |
$add_on_id = 2; // change number to correct add-on id | |
if ( isset( $checkout_fields['add_ons'][ 'wc_checkout_add_ons_' . $add_on_id ] ) ) { | |
$checkout_fields['add_ons'][ 'wc_checkout_add_ons_' . $add_on_id ]['placeholder'] = "Add a short message for a handwritten card (optional)"; | |
//Adds placeholder text | |
} |
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
/* Change the 'Only # left in stock' message on the WooCommerce product page to | |
* simply show 'Low Stock'. | |
* Add to your theme's functions.php file | |
*/ | |
function custom_stock_totals($availability_html, $availability_text, $product) { | |
if (substr($availability_text,0, 4)=="Only") { | |
$availability_text = "Supplies are running low! Get your jam!"; | |
} | |
$availability_html = '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability_text ) . '</p>'; | |
return $availability_html; |
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
function patricks_custom_variation_price( $price, $product ) { | |
$target_product_types = array( | |
'variable' | |
); | |
if ( in_array ( $product->product_type, $target_product_types ) ) { | |
// if variable product return and empty string | |
return ''; | |
} |
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
function prefix_remove_arpw_style() { | |
wp_dequeue_style( 'arpw-style' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'prefix_remove_arpw_style', 10 ); | |
/** https://wordpress.org/plugins/advanced-random-posts-widget/faq/ **/ |
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
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); | |
/** https://www.businessbloomer.com/woocommerce-remove-default-sorting-dropdown/ **/ |