Name: woogc/show_network_orders
Type: Filter
Arguments: $status
The filter can be used to show the Network Orders interface to other shops in the MultiSite environment.
The following code example, show the interface for shops ID's 2 and 3:
add_filter('woogc/show_network_orders', 'WooGC_show_network_orders');
function WooGC_show_network_orders( $status )
{
global $blog_id;
...
View More
Filter
woogc/orders/product_meta/ignore
Filter being used when retrieving a order product. Should return an array with the product meta fields to ignore.
Example
add_action('woogc/orders/product_meta/ignore', 'my_woogc_orders_product_meta_ignore');
function my_woogc_orders_product_meta_ignore($ignore)
{
$ignore[] = 'another_custom_field';
return $ignore;
...
View More
Action
woogc/options/options_html
Action being used when options output. Should be used to add more options
Example
add_action('woogc/options/options_html', 'my_woogc_options_options_html');
function my_woogc_options_options_html()
{
?>
<select name="my_custom_option">
...
View More
Filter
woogc/options/options_save
Filter being used when options saved. Should return an array containing options.
Example
add_filter('woogc/options/options_save', 'my_woogce_options_options_save');
function my_woogce_options_options_save($options)
{
//add our data
$options['my_option'] =...
View More
Name: woogc/sync/on_post_vars
Type: Filter
Arguments: $PostVars
Filter being used to acknowledge the plugin engine to proceed with synchronization, usually following a custom AJAX call which is not being recognized as a WooCommerce default. (e.g. wc-ajax=add_to_cart, wc-ajax=get_refreshed_fragments)
Certain plugins and themes use their own methods to handle the cart operations like add, remove. To create a compatibility between such code and the WooCommerce Global Cart plugin, at least a POST parameter must be registered through the 'woogc/sync/on_post_vars' filter, recommended to be a unique field. The following sample code,...
View More
Deprecated notice: The recent tracking privacy cookie policy changes, the filter is deprecated. Instead, the synchronisation screen is used for all browsers to ensure compatibility.
Name: woogc/sync/bounce_sync
Type: Filter
Arguments: $sites, $context
The synchronization procedure ensures the cart maintains unitary across all shops in the network. The procedure triggers in the background or through a synchronization screen ( mainly for the Safari browser ).
The filter instructs the code to use only the synchronization screen for all devices and browsers.
add_filter('woogc/sync/bounce_sync', 'woogc_sync_bounce_sync');
...
View More
This filter has been deprecated.
Name: woogc/disable_sso
Type: Filter
Arguments: $is_disabled
The filter is being used to disable Single Sign-On functionality. Single Sign-On (SSO) is a property of login on all sites in a MultiSite environment, using a single/unique login procedure. This works independently if other sites use different domains, subdomains or subdirectories structure.
add_filter( 'woogc/disable_sso', 'WooGC_Disable_SSO');
function WooGC_Disable_SSO ( $status )
{
...
View More
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 = '' )
{
...
View More
Name: woogc/global_cart/sites
Type: Filter
Arguments: (array) $sites_ids
The following code snippet demonstrates how to synchronize the current shop with only the designated checkout site. This selective synchronization is particularly useful when you want to minimize the number of shops involved in the network, ensuring that only the current site and the checkout site are synced. This approach optimizes performance and reduces unnecessary data transfer, focusing the synchronization process on the essential sites only.
By utilizing the woogc/global_cart/sites filter, you can easily define which sites...
View More
Name: woogc/checkout/single/split/blog_id
Type: Filter
Arguments: $blog_id, $status
The filter can be used to disable Order Split for specific Shop, when using Single Check-out and Split Order functionality.
In the following code example, disable the split for shop ID's 2:
add_filter('woogc/checkout/single/split/blog_id', '__WooGC_single_checkout_split_order_blog_id', 10, 3);
function __WooGC_single_checkout_split_order_blog_id( $status, $_blog_id, $order )
{
if ( $_blog_id == 2 )
$status...
View More
Name: woogc/checkout/single/split/trigger_email
Type: Filter
Arguments: $status, $args
By default, WooCommerce will send appropriate email messages for every order. That may not be required in certain scenarios, so better control over the sent messages is necessary. This filter helps to manage those email messages programmatically.
For example, when check-out products from two other shops, disable the emails for the main order on the check-out:
add_filter ( 'woogc/checkout/single/split/trigger_email', '__suppress_emails_for_main_order', 10, 2 );
function __suppress_emails_for_main_order( $status, $args )
...
View More
Name: woogc/single_checkout/split_order/order_created
Type: Action
Arguments: $new_order
The `woogc/single_checkout/split_order/order_created` action is triggered when a new order is created as part of the split order process in WooCommerce Global Cart. This action is specifically used when the Single Site checkout type is enabled. During this process, the core functionality creates separate orders for products that belong to different shops within the cart.
When using the Split Order with Single Checkout type, WooCommerce Global Cart processes the checkout by splitting the cart's contents into individual orders. Each order...
View More
Name: woogc/sequential_order_number/format
Type: Filter
Arguments: (int) $order_number, (int) $order_id
The woogc/sequential_order_number/format filter in WooCommerce allows you to customize the format of the order number generated for new orders within the WooCommerce Global Cart. This filter can be used to modify the default sequential order number by prepending or appending custom prefixes, suffixes, or any other modifications to suit your business needs.
Example Usage
The following code example demonstrates how to customize the order number format by adding a custom prefix to the order number:
...
View More
Name: woogc/get_checkout_url
Type: Filter
Arguments: $checkout_url
The filter is being used to change the $checkout_url for specific shops. As default this is being controlled through admin settings but can be adjusted to particular shops if need.
The following code change the checkout url to shop default when blog_id is 4:
add_filter( 'woogc/get_checkout_url', 'WooGC_get_checkout_url');
function WooGC_get_checkout_url ( $checkout_url )
{
...
View More
Name: woogc/get_gc_sites
Type: Filter
Arguments: $sites, $context
The filter can be used to exclude specific shops when WooGlobalCart core calls the internal get_gc_sites() method.
For example, a shop can be excluded from the reports.
The following code, removes shop ID's 2 from the reporting engine:
add_filter('woogc/get_gc_sites', '__WooGC_get_gc_sites', 10, 2);
function __WooGC_get_gc_sites( $sites, $context )
{
...
View More
Name: woogc/get_cart_from_session/validate_hash
Type: Filter
Arguments: $force_validation, $values
When reconstructing the cart from session data, WooCommerce checks each of the products for validation. That includes existence, quantity, purchaseability, data hash. It happens, if a plugin implements a custom product type, if not active/available for a specific shop, the WooCommerce removes it from the cart. This is caused by a data hash that does not match anymore.
This filter can be used to force hash validity for specific products in the cart.
For example, if using the...
View More
Name: woogc/ps/interfaces/synchronize_to_sites
Type: Filter
Arguments: $sites
The filter allows you to regulate the shops that are accessible within the Synchronization Interface, determining where the feature is available.
The following example check if the edit page is for product ID 33 and 44. If match, it disable the synchronization option to the Shop ID 2:
add_filter ( 'woogc/ps/interfaces/synchronize_to_sites', 'woogc_ps_interfaces_synchronize_to_sites' );
function woogc_ps_interfaces_synchronize_to_sites( $sites )
{
...
View More
Name: woogc/ps/interfaces/sync_to_shop
Type: Filter
Arguments: $status, $remote_blog_id, $post
The filter can be used to change the synchronization interface button status from active to inactive or vice versa.
For example, when creating a new product, the buttons will show up active as default:
add_filter ( 'woogc/ps/interfaces/sync_to_shop', 'woogc_ps_interfaces_option_status', 10, 3 );
add_filter ( 'woogc/ps/interfaces/maintain_child', 'woogc_ps_interfaces_option_status', 10, 3 );
add_filter ( 'woogc/ps/interfaces/maintain_categories', 'woogc_ps_interfaces_option_status',...
View More
Name: woogc/ps/synchronize_product/synchronize_product_data
Type: Action
Arguments: $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID
Arguments
Parameter
Type
Description
$prop_title
string
The name of the product property currently being synchronized (e.g. price, description, custom meta key, etc.).
$prop_value
mixed
The value of the property being synchronized.
$child_product
WC_Product object
The WooCommerce product object on the child site that is being updated.
$main_product_data
array
An associative array containing the full dataset of the origin product. Useful for syncing multiple fields.
$origin_product_blog_ID
int
The blog ID of the origin product (source site).
This hook is triggered on synchronizing custom product data for every product property and metadata, to perform...
View More
Name: woogc/ps/synchronize_product/ignore_meta_key
Type: Filter
Arguments: $IgnoreMeta, $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID
The filter can be used to ignore/skip a meta field to replicate, when running a Product synchronization procedure.
The following example ignores any parent Product Title change
add_filter ( 'woogc/ps/synchronize_product/ignore_meta_key', 'woogc_ps_synchronize_product_ignore_meta_key', 10, 6 );
function woogc_ps_synchronize_product_ignore_meta_key ( $ignore, $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID )
{
if ( $prop_title...
View More