woogc/ps/synchronize_product/child_product
Name: woogc/ps/synchronize_product/child_product
Type: Filter
Arguments:
(object)$child_product
(array)$main_product_data
(int)$origin_product_blog_ID
This filter is utilized within the WooCommerce Global Cart plugin to enable modifications to the child product object before it’s returned to the core and saved. It provides developers with the ability to customize the child product data as needed during the synchronization process.
add_filter( 'woogc/ps/synchronize_product/child_product', 'custom_modify_child_product', 10, 3 );
function custom_modify_child_product( $child_product, $main_product_data, $origin_product_blog_ID ) {
// Perform modifications to $child_product here
// Example: Change the price of the child product
$child_product->set_price( $child_product->get_price() * 1.1 ); // Increasing price by 10%
return $child_product;
}
Related Posts
Managing multiple WooCommerce shops within a WordPress Multisite environment can be challenging, especially when it comes to keeping product information consistent across all stores. The WooCommerce Product Synchronization feature in the WP Global Cart plugin addresses this challenge by enabling seamless synchronization of products across your network.
Name: woogc/sequential_order_number/format
Type: Filter
Arguments: (int) $order_number,...
Name: woogc/global_cart/sites
Type: Filter
Arguments: (array) $sites_ids
The...
Name: woogc/single_checkout/split_order/order_created
Type: Action
Arguments: $new_order
The `woogc/single_checkout/split_order/order_created` action...
The WordPress WooCommerce Global...
By default, on Product...
Name: woogc/ps/synchronize_product/child_product
Type: Filter
Arguments:
(object)$child_product
(array)$main_product_data
(int)$origin_product_blog_ID
This filter...
The WooCommerce Global Cart...
Name: woogc/ps/interfaces/sync_to_shop
Type: Filter
Arguments: $status, $remote_blog_id, $post
The...