Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Krapf thegdshop

View GitHub Profile
View Only display minimum price for WooCommerce variable products
/**
* Only display minimum price for WooCommerce variable products
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
@thegdshop
thegdshop / gist:3197540
Created Jul 29, 2012
WooCommerce - Add category body class in single product view
View gist:3197540
<?php
// add taxoonomy term to body_class
function woo_custom_taxonomy_in_body_class( $classes ){
if( is_singular( 'product' ) )
{
$custom_terms = get_the_terms(0, 'product_cat');
if ($custom_terms) {
foreach ($custom_terms as $custom_term) {
$classes[] = 'product_cat_' . $custom_term->slug;
@thegdshop
thegdshop / gist:3171026
Created Jul 24, 2012
WooCommerce - Add checkbox field to the checkout
View gist:3171026
<?php
/**
* Add checkbox field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>';
@thegdshop
thegdshop / gist:2141771
Created Mar 20, 2012
WooCommerce - Change add to cart button text
View gist:2141771
<?php
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
return __('My Button Text', 'woocommerce');
}
You can’t perform that action at this time.