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_after_single_product', 'woocommerce_upsell_display'); | |
add_action( 'woocommerce_after_single_product', 'woocommerce_output_upsells', 20); | |
if (!function_exists('woocommerce_output_upsells')) { | |
function woocommerce_output_upsells() { | |
woocommerce_upsell_display(3,3); // Display 3 products in rows of 3 | |
} | |
} |
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
if (!function_exists('woocommerce_template_single_excerpt')) { | |
function woocommerce_template_single_excerpt( $post ) { | |
global $post; | |
if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>'; | |
} | |
} |
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_thumbnails_columns', 'xx_thumb_cols' ); | |
function xx_thumb_cols() { | |
return 4; // .last class applied to every 4th thumbnail | |
} |
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(document).ready(function() { | |
jQuery( 'ul.sub-menu' ).parent().addClass( 'parent' ); | |
} |
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
// The following goes in functions.php | |
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_stock', 10); | |
function woocommerce_template_loop_stock() { | |
global $product; | |
if ( ! $product->managing_stock() && ! $product->is_in_stock() ) | |
echo '<p class="stock out-of-stock">out-of-stock</p>'; | |
} |
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( 'pre_get_posts', 'custom_pre_get_posts_query' ); | |
function custom_pre_get_posts_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$q->set( 'tax_query', array(array( |
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
// Override theme default specification for product # per row | |
function loop_columns() { | |
return 5; // 5 products per row | |
} | |
add_filter('loop_shop_columns', 'loop_columns', 999); |
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_after_shop_loop_item', 'wc_product_rating_overview', 15 ); | |
if ( ! function_exists( 'wc_product_rating_overview' ) ) { | |
function wc_product_rating_overview() { | |
global $product; | |
echo $product->get_rating_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
// Remove the product rating display on product loops | |
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); |
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 wp_enqueue_woocommerce_style(){ | |
wp_register_style( 'mytheme-woocommerce', get_template_directory_uri() . '/css/woocommerce.css' ); | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_enqueue_style( 'mytheme-woocommerce' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'wp_enqueue_woocommerce_style' ); |