• Resolved Sheine

    (@sheine)


    Hello,

    I have a few questions regarding my cart page:

    1: i am receiving the following errors on my cart page:

    Warning: array_keys() expects parameter 1 to be array, null given in /home/meenemen/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 465
    Warning: array_keys() expects parameter 1 to be array, null given in /home/meenemen/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 436
    Warning: current() expects parameter 1 to be array, null given in /home/meenemen/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 437

    2. My shipping methods are not showing anymore, although i have 3 options in my woocommerce settings. (is this because of the error?)

    3. Please help me so my shipping methods show correctly:
    I have three shipping options: 1) free shipping above 50 EUR 2) Shipping rate 3,95 EUR when < 50 EUR 3) Servicepoint drop off (Sendcloud.nl integration). I have added the Sendcloud shipping method to my woocommerce shipping settings. What i am trying to achieve is:
    a. When amount = < 50 EUR: show both shipping rate 3,95EUR and servicepoint dropoff 3,95 EUR.
    b. When amount = > 50 EUR: show both free shipping 0,00EUR and servicepoint dropoff 0,00 EUR.

    Would love if you could help me with this.

    Kind regards,

    Sven Heinen

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Sheine

    (@sheine)

    Anyone?

    Kind rgeards,

    Sven

    Please paste your WC System Status Report

    Thread Starter Sheine

    (@sheine)

    @Soft79:

    
    ### WordPress Environment ###
    
    Home URL: http://meenemenopreis.nl
    Site URL: http://meenemenopreis.nl
    WC Version: 3.5.1
    Log Directory Writable: ✔
    WP Version: 4.9.8
    WP Multisite: –
    WP Memory Limit: 768 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: nl_NL
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 5.6.38 - We raden je aan om PHP-versie 7.2 of hoger te gebruiken voor betere prestaties en beveiliging. Hoe je PHP-versie bijwerken
    PHP Post Max Size: 128 MB
    PHP Time Limit: 0
    PHP Max Input Vars: 5000
    cURL Version: 7.59.0
    OpenSSL/1.0.2k
    
    SUHOSIN Installed: –
    MySQL Version: 5.6.40-84.0-log
    Max Upload Size: 128 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.5.1
    WC Database Prefix: wpvu_
    MaxMind GeoIP Database: ✔
    Totale databasegrootte: 13.94MB
    Database datagrootte: 11.75MB
    Database index grootte: 2.19MB
    wpvu_woocommerce_sessions: Data: 0.09MB + Index: 0.02MB
    wpvu_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
    wpvu_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
    wpvu_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
    wpvu_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
    wpvu_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
    wpvu_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
    wpvu_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
    wpvu_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
    wpvu_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
    wpvu_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
    wpvu_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
    wpvu_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
    wpvu_woocommerce_log: Data: 0.02MB + Index: 0.02MB
    wpvu_commentmeta: Data: 0.02MB + Index: 0.03MB
    wpvu_comments: Data: 0.02MB + Index: 0.09MB
    wpvu_failed_jobs: Data: 0.02MB + Index: 0.00MB
    wpvu_links: Data: 0.02MB + Index: 0.02MB
    wpvu_mailchimp_carts: Data: 0.02MB + Index: 0.00MB
    wpvu_mollie_pending_payment: Data: 0.02MB + Index: 0.00MB
    wpvu_options: Data: 7.05MB + Index: 1.03MB
    wpvu_pmxe_exports: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxe_google_cats: Data: 0.39MB + Index: 0.00MB
    wpvu_pmxe_posts: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxe_templates: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxi_files: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxi_history: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxi_images: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxi_imports: Data: 0.02MB + Index: 0.00MB
    wpvu_pmxi_posts: Data: 0.02MB + Index: 0.03MB
    wpvu_pmxi_templates: Data: 0.02MB + Index: 0.00MB
    wpvu_postmeta: Data: 0.36MB + Index: 0.19MB
    wpvu_posts: Data: 2.47MB + Index: 0.13MB
    wpvu_queue: Data: 0.02MB + Index: 0.00MB
    wpvu_revslider_css: Data: 0.13MB + Index: 0.00MB
    wpvu_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB
    wpvu_revslider_navigations: Data: 0.02MB + Index: 0.00MB
    wpvu_revslider_sliders: Data: 0.05MB + Index: 0.00MB
    wpvu_revslider_slides: Data: 0.31MB + Index: 0.00MB
    wpvu_revslider_static_slides: Data: 0.02MB + Index: 0.00MB
    wpvu_termmeta: Data: 0.02MB + Index: 0.03MB
    wpvu_terms: Data: 0.02MB + Index: 0.03MB
    wpvu_term_relationships: Data: 0.02MB + Index: 0.02MB
    wpvu_term_taxonomy: Data: 0.02MB + Index: 0.03MB
    wpvu_usermeta: Data: 0.02MB + Index: 0.03MB
    wpvu_users: Data: 0.02MB + Index: 0.05MB
    wpvu_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB
    wpvu_wc_download_log: Data: 0.02MB + Index: 0.03MB
    wpvu_wc_webhooks: Data: 0.02MB + Index: 0.02MB
    wpvu_yith_wcwl: Data: 0.02MB + Index: 0.02MB
    wpvu_yith_wcwl_lists: Data: 0.02MB + Index: 0.03MB
    wpvu_yoast_seo_links: Data: 0.02MB + Index: 0.02MB
    wpvu_yoast_seo_meta: Data: 0.02MB + Index: 0.00MB
    
    ### Post Type Counts ###
    
    attachment: 75
    custom_css: 1
    customize_changeset: 195
    etheme_portfolio: 6
    jetpack_migration: 2
    mc4wp-form: 1
    nav_menu_item: 40
    page: 25
    post: 1
    product: 8
    product_variation: 2
    revision: 421
    shop_order: 9
    sidebar_instance: 1
    staticblocks: 11
    vc_grid_item: 2
    vc_settings_preset: 1
    vc4_templates: 2
    wpcf7_contact_form: 2
    wpforms: 2
    
    ### Security ###
    
    Secure connection (HTTPS): ❌
    					Jouw winkel gebruikt geen HTTPS. Leer meer over HTTPS en SSL-certificaten.
    Hide errors from visitors: ✔
    
    ### Active Plugins (29) ###
    
    Redux Framework: door Team Redux – 3.6.14
    CMB2: door CMB2 team – 2.4.2
    Contact Form 7: door Takayuki Miyoshi – 5.0.5
    Easy Custom Sidebars: door Titanium Themes – 1.0.9
    XStore Core: door 8theme – 1.1.6
    Flexible Bestellen Fields: door WP Desk – 1.6.10
    Google Analytics for WordPress by MonsterInsights: door MonsterInsights – 7.3.0
    Jetpack door WordPress.com: door Automattic – 6.7
    WPBakery Page Builder: door Michael M - WPBakery.com – 5.5.5
    Loco Translate: door Tim Whitlock – 2.1.5
    Mailchimp for WooCommerce: door Mailchimp – 2.1.11 – Niet getest met de actieve versie van WooCommerce
    MailChimp for WordPress: door ibericode – 4.2.5
    Mega Addons For Visual Composer: door Nasir – 2.2
    Mollie Payments for WooCommerce: door Mollie – 5.0.4
    Slider Revolution: door ThemePunch – 5.4.8
    SendCloud | Smart Shipping Service: door SendCloud B.V. – 1.0.16
    SG Optimizer: door SiteGround – 4.0.7
    Simply Show Hooks: door Stuart O'Brien
    cxThemes – 1.2.1
    
    W3 Total Cache: door Frederick Townes – 0.9.7
    WC Hide Shipping Methods: door Rynaldo Stoltz – 1.3
    WooCommerce PDF Invoices & Packing Slips: door Ewout Fernhout – 2.2.4
    WooCommerce Services: door Automattic – 1.17.1
    WooCommerce: door Automattic – 3.5.1
    WordPress Importeerder: door wordpressdotorg – 0.6.4
    Yoast SEO: door Team Yoast – 9.1
    WP All Export: door Soflyy – 1.2.1
    WP All Import: door Soflyy – 3.4.9
    WPForms Lite: door WPForms – 1.4.9
    YITH WooCommerce Wishlist: door YITH – 2.2.5
    
    ### Settings ###
    
    API Enabled: ✔
    Force SSL: –
    Currency: EUR (€)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    ### WC Pages ###
    
    Winkelbasis: #5232 - /shop/
    Winkelmand: #5233 - /winkelmand/
    Afrekenen: #5234 - /bestellen/
    Mijn account: #5235 - /mijn-account/
    Algemene voorwaarden: ❌ Pagina niet ingesteld
    
    ### Theme ###
    
    Name: Xstore Child
    Version: 1.0
    Author URL: http://8theme.com
    Child Theme: ✔
    Parent Theme Name: XStore
    Parent Theme Version: 5.1.1
    Parent Theme Author URL: http://www.8theme.com
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: xstore/woocommerce/archive-product.php
    xstore/woocommerce/cart/cart-empty.php
    xstore/woocommerce/cart/cart-item-data.php
    xstore/woocommerce/cart/cart.php
    xstore/woocommerce/cart/cross-sells.php
    xstore/woocommerce/cart/mini-cart.php
    xstore/woocommerce/checkout/form-billing.php
    xstore/woocommerce/checkout/form-checkout.php
    xstore/woocommerce/checkout/form-shipping.php
    xstore/woocommerce/checkout/thankyou.php
    xstore/woocommerce/content-product.php
    xstore/woocommerce/content-product_cat.php
    xstore/woocommerce/content-single-product.php
    xstore/woocommerce/content-widget-product.php
    xstore/woocommerce/content-widget-reviews.php
    xstore/woocommerce/global/breadcrumb.php
    xstore/woocommerce/global/form-login.php
    xstore/woocommerce/global/quantity-input.php
    xstore/woocommerce/global/wrapper-end.php
    xstore/woocommerce/global/wrapper-start.php
    xstore/woocommerce/loop/loop-end.php
    xstore/woocommerce/loop/loop-start.php
    xstore/woocommerce/loop/no-products-found.php
    xstore/woocommerce/loop/result-count.php
    xstore/woocommerce/loop/sale-flash.php
    xstore/woocommerce/single-product/add-to-cart/simple.php
    xstore/woocommerce/single-product/meta.php
    xstore/woocommerce/single-product/product-image.php
    xstore/woocommerce/single-product/related.php
    xstore/woocommerce/single-product/sale-flash.php
    xstore/woocommerce/single-product/short-description.php
    xstore/woocommerce/single-product/tabs/additional-information.php
    xstore/woocommerce/single-product/tabs/description.php
    xstore/woocommerce/single-product/tabs/tabs.php
    xstore/woocommerce/single-product/title.php
    xstore/woocommerce/single-product/up-sells.php
    xstore/woocommerce/single-product.php
    
    
    Thread Starter Sheine

    (@sheine)

    Anyone?

    Sven

    Try disabling WC Hide Shipping Methods. Does that help? Otherwise try disabling SendCloud temporarily to see if that helps.

    Do you have any shipping related filters in your child theme?

    Thread Starter Sheine

    (@sheine)

    I have removed WC Hide Shipping Methods and disabled Sendcloud.
    the errors still exists.

    Even though i have two shipping methods for the Netherlands in my Woocommerce > Shipping options, none shows in the cart. It gives the message: Add address to see shipping options.

    When i look in the code the errors apparently are in the following lines:
    $rate_keys = array_keys( $package[‘rates’] ); (this is line 436)
    $default = current( $rate_keys ); (this is line 437)
    They are part of the following code:

    /**
    * Choose the default method for a package.
    *
    * @since 3.2.0
    * @param int $key Key of package.
    * @param array $package Package data array.
    * @param string $chosen_method Chosen method id.
    * @return string
    */
    function wc_get_default_shipping_method_for_package( $key, $package, $chosen_method ) {
    $rate_keys = array_keys( $package[‘rates’] );
    $default = current( $rate_keys );
    $coupons = WC()->cart->get_coupons();
    foreach ( $coupons as $coupon ) {
    if ( $coupon->get_free_shipping() ) {
    foreach ( $rate_keys as $rate_key ) {
    if ( 0 === stripos( $rate_key, ‘free_shipping’ ) ) {
    $default = $rate_key;
    break;
    }
    }
    break;
    }
    }
    return apply_filters( ‘woocommerce_shipping_chosen_method’, $default, $package[‘rates’], $chosen_method );
    }

    The error message for line 465 is in the following code:
    $new_rates = array_keys( $package[‘rates’] ); (this is line 465) in the following code:

    **
    * See if the methods have changed since the last request.
    *
    * @since 3.2.0
    * @param int $key Key of package.
    * @param array $package Package data array.
    * @return bool
    */
    function wc_shipping_methods_have_changed( $key, $package ) {
    // Lookup previous methods from session.
    $previous_shipping_methods = WC()->session->get( ‘previous_shipping_methods’ );
    // Get new and old rates.
    $new_rates = array_keys( $package[‘rates’] );
    $prev_rates = isset( $previous_shipping_methods[ $key ] ) ? $previous_shipping_methods[ $key ] : false;
    // Update session.
    $previous_shipping_methods[ $key ] = $new_rates;
    WC()->session->set( ‘previous_shipping_methods’, $previous_shipping_methods );
    return $new_rates !== $prev_rates;
    }

    Thread Starter Sheine

    (@sheine)

    I also removed all shipping related filters in the child themes functions.php.

    What can i try?

    @Soft79

    • This reply was modified 5 years, 5 months ago by Sheine.

    When I go to your checkout page I do get 2 shipping methods: Thuis bezorgen and Servicepunt levering. Try in a private browser window, does the issue still occur?

    Kenin

    (@kbassart)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Errors on cart and checkout page’ is closed to new replies.