remove_action( 'woocommerce_after_single_product_summary','woocommerce_output_related_products', 20 );
add_action( 'woocommerce_single_product_summary','woocommerce_output_related_products', 15 );
remove_action( 'woocommerce_after_single_product_summary','woocommerce_upsell_display', 15 );
add_action( 'woocommerce_single_product_summary','woocommerce_upsell_display', 16 );
function extractHostname(url) {
var hostname;
//find & remove protocol (http, ftp, etc.) and get hostname
if (url.indexOf("//") > -1) {
hostname = url.split('/')[2];
}
else {
hostname = url.split('/')[0];
}
//find & remove port number
hostname = hostname.split(':')[0];
//find & remove "?"
hostname = hostname.split('?')[0];
return hostname;
}
switch(extractHostname(window.location.href)) {
case 'site1.domain.com':
///код для site1
break;
case 'site2.domain.com':
///код для site2
break;
default:
//код, если нет предыдущих совпадений
}