woogc/disable_global_cart
Name: woogc/disable_global_cart
Type: Filter
Arguments: $is_disabled
The filter is being used to disable the Global Cart functionality. The Global Cart works as a unique cart for all shops in the MultiSite Network, a product pushed to the cart will be show on all other shops too.
add_filter( 'woogc/disable_global_cart', 'WooGC_Disable_GlobalCart', 10, 2 );
function WooGC_Disable_GlobalCart ( $status, $_blog_id = '' )
{
return TRUE;
}
The code should be placed inside a php file on wp-content/mu-plugins folder.
The Global Cart can be disabled for individual sites, the following code can be used, in this example, the 3 and 4 are the sites ID that will be disabled:
define ( 'WooGC_GC_Ignore_Sites', array( 3, 4 ) );
add_filter( 'woogc/disable_global_cart', 'WooGC_Disable_GlobalCart');
function WooGC_Disable_GlobalCart ( $status, $_blog_id = '' )
{
global $blog_id;
if ( empty ( $_blog_id ) )
$_blog_id = $blog_id;
if ( in_array( $_blog_id, WooGC_GC_Ignore_Sites ))
return TRUE;
return $status;
}