I am having a similar issue since the latest update. I used to be able to use this code to retrieve the global field data on the cart page, but no longer.
add_action( 'woocommerce_before_calculate_totals', 'getcustomfield', 10, 1 );
function getcustomfield( $cart ) {
foreach ( $cart->get_cart() as $cart_item ) {
$customfield = $cart_item['alg_wc_pif_global'][0]['_value'];
}
}
I tried using print_r($cart_item[‘alg_wc_pif_global’]); to find the _value field but it seems to be gone. I also tried using ‘alg_wc_pif_global_1’ and all other variations, but without success. Can anybody help?
I am having the same issue with the ‘alg_wc_pif_local’ field, since the latest update.
-
This reply was modified 3 years ago by sanderwit.