Skip to content

Instantly share code, notes, and snippets.

Tiago Dias funkysoul

Block or report user

Report or block funkysoul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@funkysoul
funkysoul / gist:0272864621d1ae8fc25aaeed6b85f8ad
Created Jan 24, 2017
WooCommerce copy fields from wp_usermeta table to xyz
View gist:0272864621d1ae8fc25aaeed6b85f8ad
UPDATE wp_usermeta AS target
LEFT JOIN wp_usermeta AS source ON source.user_id = source.user_id AND source.meta_key = 'billing_last_name'
SET target.meta_value = source.meta_value
WHERE target.user_id = source.user_id AND target.meta_key = 'last_name'
View gist:c27bb013adb9cb847cfff4f5ee8c3847
//GET CATEGORIES FOR NAVIGATION
add_action('tauchbar_get_cats', 'getCatTree', 15);
function getCatTree(){
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$empty = 0;
@funkysoul
funkysoul / hide-shipping-methods.php
Created Jan 27, 2016
Woocommerce Snippet on hiding all shipment methods when free shipping is available
View hide-shipping-methods.php
add_filter( 'woocommerce_available_shipping_methods', 'hide_all_shipping_when_free_is_available' , 10, 1 );
function hide_all_shipping_when_free_is_available( $available_methods ) {
if( isset( $available_methods['free_shipping'] ) ) :
$freeshipping = array(); $freeshipping = $available_methods['free_shipping'];
array unset( $available_methods );
$available_methods = array();
$available_methods[] = $freeshipping;
endif;
@funkysoul
funkysoul / min-variation-price.php
Last active Jan 27, 2016
Woocommerce Snippet on how to change the variation price so it only displays the lowest
View min-variation-price.php
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('Ab&nbsp;', 'min_price', 'woocommerce') . ' </span>';
$price .= woocommerce_price($product->min_variation_price);
return $price;
}
You can’t perform that action at this time.