wuspum
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Plugins
In reply to: [YayMail - WooCommerce Email Customizer] Modify order item dataHey @chiape ,
Just for the record, the solution works for me.The thing here is that something must’ve changed between these two woocommerce versions that “broke / changed” the functionality. Checking the cart worked well in custom endpoints even when logged in. At least using this function.
function check_prerequisites() { // var_dump(WC()->cart); if ( defined( 'WC_ABSPATH' ) ) { // WC 3.6+ - Cart and other frontend functions are not included for REST requests. include_once WC_ABSPATH . 'includes/wc-cart-functions.php'; include_once WC_ABSPATH . 'includes/wc-notice-functions.php'; include_once WC_ABSPATH . 'includes/wc-template-hooks.php'; } if ( null === WC()->session ) { $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' ); WC()->session = new $session_class(); WC()->session->init(); } if ( null === WC()->customer ) { WC()->customer = new WC_Customer( get_current_user_id(), true ); } if ( null === WC()->cart ) { WC()->cart = new WC_Cart(); WC()->cart->get_cart(); } }But it is obviously the woocommerce problem. Like mentioned on connected issue, it also happens on fresh Woocommerce / Storefront installation.
I tested on fresh wordpress / storefront installation and the problem remains.
Viewing 5 replies - 1 through 5 (of 5 total)