• switch_to_blog(2);
    WC();
    restore_current_blog();

    The WC() refers to the WC instance from the current blog and not the one I’ve switched to. If I manually instantiate new WC_Session_Handler() after switch_to_blog() it shows the correct session though.

    I need this so I can synchronize carts between the different sites in a Multisite installation.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter Martin Sotirov

    (@martinsotirov)

    Nevermind, I found another way to synchronize the different carts via transients (at least when the user is logged in).

Viewing 1 replies (of 1 total)
  • The topic ‘Initializing WC manually doesn't respect Multisite switch_to_blog() function’ is closed to new replies.