• Resolved apexdigitalro

    (@apexdigitalro)


    Hello, we are having issues when adding any product to cart when in a different language. This has only been happening recently.

    Here’s what the console says: https://ctfo.ca/fr/?wc-ajax=add_to_cart – ERROR 500

    Here is the error: it seems to have something to do with WooCommerce’s shipping:

    [26-Jul-2023 10:58:03 UTC] PHP Fatal error: Uncaught ArgumentCountError: 3 arguments are required, 2 given in /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-shipping.php:165 Stack trace: #0 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(165): sprintf() #1 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(336): WC_Shipping->load_shipping_methods() #2 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(260): WC_Shipping->calculate_shipping_for_package() #3 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1428): WC_Shipping->calculate_shipping() #4 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(346): WC_Cart->calculate_shipping() #5 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(857): WC_Cart_Totals->get_shipping_from_cart() #6 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(151): WC_Cart_Totals->calculate_shipping_totals() #7 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(141): WC_Cart_Totals->calculate() #8 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1406): WC_Cart_Totals->__construct() #9 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(306): WC_Cart->calculate_totals() #10 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #11 /home/ctfoca/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1284): do_action() #13 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(464): WC_Cart->add_to_cart() #14 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(308): WC_AJAX::add_to_cart() #15 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #16 /home/ctfoca/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #17 /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(96): do_action() #18 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(308): WC_AJAX::do_wc_ajax() #19 /home/ctfoca/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #20 /home/ctfoca/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #21 /home/ctfoca/public_html/wp-includes/template-loader.php(13): do_action() #22 /home/ctfoca/public_html/wp-blog-header.php(19): require_once(‘/home/ctfoca/pu…’) #23 /home/ctfoca/public_html/index.php(17): require(‘/home/ctfoca/pu…’) #24 {main} thrown in /home/ctfoca/public_html/wp-content/plugins/woocommerce/includes/class-wc-shipping.php on line 165



    Can you please help us with this?

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

Viewing 1 replies (of 1 total)
  • Hi there,

    To troubleshoot this, I recommend doing a compatibility test.

    Here’s how you can proceed:

    1. Temporarily deactivate all other plugins except TranslatePress and WooCommerce. This will help us determine if there is a conflict with another plugin.
    2. Switch to a default WordPress theme like Twenty Twenty-One. This will help us determine if the issue is related to your current theme.
    3. Once you’ve completed the above steps, try adding a product to the cart in a different language to see if the issue persists.
    4. If the issue is resolved, you can reactivate your plugins and theme one by one to identify which one was causing the conflict.

    This compatibility test will help us narrow down the cause of the problem and find a solution. Please let me know if you have any further questions or if there’s anything else I can assist you with.

    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Fatal Error when adding to cart in a different language’ is closed to new replies.