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
// Based on http://wcdocs.woothemes.com/snippets/hide-other-shipping-methods-when-free-shipping-is-available/ | |
// Goes beyond by hiding the default internation shipping too | |
// Hide shipping options when free shipping is available | |
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 ); | |
/** | |
* Hide Standard Shipping option when free shipping is available | |
* | |
* @param array $available_methods | |
*/ |
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
// Change the paypal icon | |
add_filter('woocommerce_paypal_icon', 'custom_woocommerce_paypal_icon'); | |
function custom_woocommerce_paypal_icon( $url ) { | |
$url = get_bloginfo('template_url')."/assets/img/payment-icons.png"; | |
return $url; | |
} |
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
// Looks up the slug of the attribute and manually replaces it with the text | |
// Within single-product/add-to-cart/variable.php replace the line: | |
// <option value=""><?php echo __( 'Choose an option', 'woocommerce' ) ?>…</option> | |
<option value=""> | |
<?php | |
if ($name == 'pa_colour') { | |
$attr_name = 'Colour'; | |
} elseif ($name == 'pa_size') { | |
$attr_name = 'Size'; | |
} |
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
add_filter( 'woocommerce_get_price_html', 'warnies_price_html', 100, 2 ); | |
function warnies_price_html( $price, $product ){ | |
return '<div class="price">' . $price . '</div>'; | |
} |
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
/*========================================= | |
ACF Repeater | |
======================================== */ | |
add_action( 'woo_post_inside_after', 're_acf_repeater', 10); // hook is the first part | |
function re_acf_repeater () { ?> | |
<?php if(get_field('field_name')): ?> | |
<ul> | |
<?php while(has_sub_field('field_name')) { ?> |
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
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
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
function woocommerce_result_count() {} |
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 | |
/** | |
* Single product quantity inputs | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 2.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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
/* Add to cart button text */ | |
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
function woo_custom_cart_button_text() { | |
return __('Add to Cart', 'woocommerce'); | |
} |