Hello there.
Basically, fix would look like this:
...
$has_giftcard = "no";
// Check if cart is empty before going through the loop.
if ( empty( WC()->cart ) ) {
return $enabled;
}
foreach ( WC()->cart->get_cart() as $key => $product ) {
...
Hope this helps.
Milos
Hello guys,
I think I found the source of the problems.
Inside the script {plugin}/includes/functions.php on line 84
seams that WC()->cart object still don’t exists and it’s null which cause the fatal error and not loading the rest of the site content.
Quick fix would be just to check if WC()->cart is empty before going trough foreach loop.
Hope you can look into this before next update.
Cheers.