Final Error
-
Error message: Uncaught Error: Call to a member function get_cart() on null
class-jp4wc-virtual.php 内の foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
カートが空/nullのチェックが抜けている様です。if ( ! is_null(WC()->cart) ) { <- null チェック追加
foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
// Check if there are non-virtual products
if ( ! $cart_item[‘data’]->is_virtual() ) $only_virtual = false;
}
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Final Error’ is closed to new replies.