Repository Forums Support WooCommerce Extended Coupon Features PRO Js error when free shipping is selected

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19799
    Jan Lydman
    Participant

    Hi,

    We have a latest pro version of your plugin and wp core is also updated to the latest version. When I use coupon that has percentage discount and “Allow free shipping” checked, in the checkout, page gets stuck loading ajax call and we get js error on jquery.js and woocommerce checkout.min.js. If I refresh page, there is a php error: Fatal error: Uncaught Error: Call to a member function get_meta() on string in …/public/wp-content/plugins/woocommerce-auto-added-coupons-pro/pro/plugins/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php on line 764

    This does not happen if I uncheck the Allow free shipping option. In the shipping methods, we have free shipping method configured and in Free shipping requires… part we have selected: a valid free shipping coupon.

    I can send you admin credentials if needed.

    #19800
    Soft79
    Keymaster

    Please provide the full stack trace of the error

    #19801
    Jan Lydman
    Participant

    Here is the full stack trace:
    Fatal error: Uncaught Error: Call to a member function get_meta() on string in /home/sinituotefi/website/wp-content/plugins/woocommerce-auto-added-coupons-pro/pro/plugins/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php:764 Stack trace: #0 /home/sinituotefi/website/wp-content/themes/storefront/assets/functions/WC_SINI_Shipping.php(270): WJECF_Pro_Free_Products->get_coupon_free_product_ids() #1 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php(233): WC_SINI_Shipping->calculate_shipping() #2 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(348): WC_Shipping_Method->get_rates_for_package() #3 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(260): WC_Shipping->calculate_shipping_for_package() #4 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1423): WC_Shipping->calculate_shipping() #5 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(339): WC_Cart->calculate_shipping() #6 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(850): WC_Cart_Totals->get_shipping_from_cart() #7 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(144): WC_Cart_Totals->calculate_shipping_totals() #8 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(134): WC_Cart_Totals->calculate() #9 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1401): WC_Cart_Totals->__construct() #10 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(298): WC_Cart->calculate_totals() #11 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(67): WC_Shortcode_Checkout::checkout() #12 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(72): WC_Shortcode_Checkout::output() #13 /home/sinituotefi/website/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(95): WC_Shortcodes::shortcode_wrapper() #14 /home/sinituotefi/website/wp-includes/shortcodes.php(355): WC_Shortcodes::checkout() #15 [internal function]: do_shortcode_tag() #16 /home/sinituotefi/website/wp-includes/shortcodes.php(227): preg_replace_callback() #17 /home/sinituotefi/website/wp-includes/class-wp-hook.php(308): do_shortcode() #18 /home/sinituotefi/website/wp-includes/plugin.php(205): WP_Hook->apply_filters() #19 /home/sinituotefi/website/wp-includes/post-template.php(255): apply_filters() #20 /home/sinituotefi/website/wp-content/themes/storefront/inc/storefront-template-functions.php(365): the_content() #21 /home/sinituotefi/website/wp-includes/class-wp-hook.php(308): storefront_page_content() #22 /home/sinituotefi/website/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #23 /home/sinituotefi/website/wp-includes/plugin.php(517): WP_Hook->do_action() #24 /home/sinituotefi/website/wp-content/themes/storefront/content-page.php(21): do_action() #25 /home/sinituotefi/website/wp-includes/template.php(785): require(‘/home/sinituote…’) #26 /home/sinituotefi/website/wp-includes/template.php(718): load_template() #27 /home/sinituotefi/website/wp-includes/general-template.php(204): locate_template() #28 /home/sinituotefi/website/wp-content/themes/storefront/templates/template-fullwidth.php(22): get_template_part() #29 /home/sinituotefi/website/wp-includes/template-loader.php(106): include(‘/home/sinituote…’) #30 /home/sinituotefi/website/wp-blog-header.php(19): require_once(‘/home/sinituote…’) #31 /home/sinituotefi/website/index.php(17): require(‘/home/sinituote…’) #32 {main} thrown in /home/sinituotefi/website/wp-content/plugins/woocommerce-auto-added-coupons-pro/pro/plugins/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php on line 764

    #19803
    Soft79
    Keymaster

    Source of the problem is in this template file. Please let your theme developer take a look at it.

    /home/sinituotefi/website/wp-content/themes/storefront/assets/functions/WC_SINI_Shipping.php

    Please note: This is not an existing file in the original storefront theme. It looks like changes have been made to the storefront theme without using a child theme. This is not recommended!

    #19804
    Jan Lydman
    Participant

    Ok, thanks for the info, we’ll check this. Apparently this is a custom functionality made years ago by previous developer, straight to the storefront theme, which is not(as you mentioned) the correct way.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.