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
<?php | |
// Place in your theme's functions.php file | |
// Revert grouped product prices to WooCommerce 2.0 format | |
add_filter( 'woocommerce_grouped_price_html', 'wc_wc20_grouped_price_format', 10, 2 ); | |
function wc_wc20_grouped_price_format( $price, $product ) { | |
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' ); | |
$child_prices = array(); | |
foreach ( $product->get_children() as $child_id ) { | |
$child_prices[] = get_post_meta( $child_id, '_price', true ); |
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
<?php | |
// Show trailing zeros on prices, default is to hide it. | |
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 ); | |
function wc_hide_trailing_zeros( $trim ) { | |
// set to false to show trailing zeros | |
return false; | |
} | |
?> |
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 free price text | |
function custom_free_price( $price, $product ) { | |
return ''; | |
} | |
add_filter( 'woocommerce_free_sale_price_html', 'custom_free_price', 10, 2 ); | |
add_filter( 'woocommerce_free_price_html', 'custom_free_price', 10, 2 ); | |
add_filter( 'woocommerce_variable_free_price_html', 'custom_free_price', 10, 2 ); | |
add_filter( 'woocommerce_variable_free_sale_price_html', 'custom_free_price', 10, 2 ); |
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 empty price | |
function custom_empty_price( $price, $product ) { | |
return __( 'Call or Email for price', 'WooCommerce' ) ; | |
} | |
add_filter( 'woocommerce_variable_empty_price_html', 'custom_empty_price', 10, 2 ); | |
add_filter( 'woocommerce_empty_price_html', 'custom_empty_price', 10, 2 ); |
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
jQuery( '.currency_switcher li a' ).each( function() { | |
jQuery( this ).parent().addClass( jQuery( this ).attr( 'data-currencycode' ) ); | |
}); |
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_before_shop_loop', 'woocommerce_catalog_ordering', 11 ); | |
remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); |
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_get_price_html', 'woocommerce_nyp_min_price', 11, 2 ); | |
function woocommerce_nyp_min_price( $price, $product ) { | |
if ( !$product->nyp ) | |
return $price; | |
if( is_shop() || is_product_category() || is_product_tag() ) { | |
$price = woocommerce_price( $product->minimum ); | |
} | |
return $price; |
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_is_sold_individually', 'wc_remove_all_quantity_fields', 10, 2 ); | |
function wc_remove_all_quantity_fields( $return, $product ) { | |
if ( is_product() ) | |
return true; | |
else return $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 woocommerce_content() { | |
if ( is_singular( 'product' ) ) { | |
while ( have_posts() ) : the_post(); | |
woocommerce_get_template_part( 'content', 'single-product' ); | |
endwhile; |
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_before_main_content', 'my_theme_wrapper_start', 10); | |
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); | |
function my_theme_wrapper_start() { | |
echo '<div class="fixed">'; | |
echo '<div class="content-home-right">'; | |
} | |
function my_theme_wrapper_end() { | |
echo '</div>'; |
OlderNewer