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 wc_custom_upsell_sorting() { | |
woocommerce_upsell_display( - 1, 4, 'menu_order', 'ASC' ); | |
} | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); | |
add_action( 'woocommerce_after_single_product_summary', 'wc_custom_upsell_sorting', 15 ); |
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 filter_woocommerce_get_stock_html( $html, $product ) { | |
if ( $product->stock_status == 'outofstock' ) { | |
$html .= 'Add custom HTML here'; | |
} | |
return $html; | |
} | |
add_filter( 'woocommerce_get_stock_html', 'filter_woocommerce_get_stock_html', 10, 2 ); |