Search
woogc/ps/synchronize_product/child_product - WP Global Cart
17286
documentation-template-default,single,single-documentation,postid-17286,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,wpb-js-composer js-comp-ver-6.3.0,vc_responsive
 

woogc/ps/synchronize_product/child_product

WP Global Cart / woogc/ps/synchronize_product/child_product
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

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;
}
0
Would love your thoughts, please comment.x
()
x