Me too:
Notice: Undefined index: section in …/public_html/wp-content/plugins/gift-cards-for-woocommerce/includes/class.settings.php on line 106
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.
Hi Milos!
This is what I have for line 84:
foreach ( WC()->cart->get_cart() as $key => $product) {
Does that look right? If not, can I make a change to fix the issue?
Thanks.
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
@mpetkovic
Unfortunately, that didn’t seem to fix the problem. If you have any other ideas, let me know!
Thanks for the quick reply!