• Resolved wooassist

    (@wooassist)


    We are having some issues with the plugin causing this kind of error that comes out in a specific account.

    To replicate the issue whenever our customer login to her account she can see this error Illegal string offset ‘cart’ https://imgur.com/SkA8A5i

    We tried to deactivate the plugin and the error is not showing. It was working perfectly fine and suddenly this kind of error came up.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor chetnapatel

    (@chetnapatel)

    Hi,

    Thank you for sharing the screenshot of error message.

    We have applied the fix on our staging server. And we will release the same fix in the next plugin update.

    You can fix the issue as below by changing the code from line number 1743 to 1783 in the same “woocommerce-ac.php” file of our plugin. It is located at “woocommerce-abandoned-cart” core folder of our plugin.

    if ( isset( $current_woo_cart['cart'] ) && isset( $abandoned_cart_arr['cart'] ) ) {  
                    $temp_variable      = "";  
                    if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
                        //do nothing
                    } else {
                        $temp_variable      = $current_woo_cart;
                        $current_woo_cart   = $abandoned_cart_arr;
                        $abandoned_cart_arr = $temp_variable;
                    }
                    if ( is_array( $current_woo_cart ) && is_array( $abandoned_cart_arr ) ) {
                        foreach ( $current_woo_cart as $key => $value ) {
                            
                            foreach ( $value as $item_key => $item_value ) {
                                $current_cart_product_id   = $item_value['product_id'];
                                $current_cart_variation_id = $item_value['variation_id'];
                                $current_cart_quantity     = $item_value['quantity'];
                
                                if ( isset( $abandoned_cart_arr[$key][$item_key]['product_id'] ) ) {
                                    $abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
                                } else {
                                    $abandoned_cart_product_id = "";
                                }
                                if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
                                     $abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id']; 
                                } else {
                                    $abandoned_cart_variation_id = "";
                                }
                                if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
                                     $abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
                                } else {
                                     $abandoned_cart_quantity = "";
                                }
                                if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
                                     ( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
                                     ( $current_cart_quantity != $abandoned_cart_quantity ) )
                                {
                                    return false;
                                }
                            }
                        }
                    }
                }
                return true;

    Can you please change the code and let me know if the issue still persists or not?

    Please let me know if you have any further queries.

    Regards,
    Chetna Bhutka

    Thread Starter wooassist

    (@wooassist)

    Hi,

    Thank you for your fast response, I tried the apply the fix and it’s working now.

    Plugin Contributor chetnapatel

    (@chetnapatel)

    Hi,

    I am glad to know that provided solution is worked for you.

    Let me know if you have any further queries regarding our plugin.

    Regards,
    Chetna Bhutka

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Illegal string offset ‘cart’’ is closed to new replies.