• Resolved b1naryc0d3

    (@b1naryc0d3)


    Hi there!

    Having a hard time trying to figure this out.

    When adding composite products from the french site, it works. When switching to english and trying to add the same product, it will fail with this error:

    [15-Jun-2021 02:06:59 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_price() on null in /home2/wp-content/plugins/woocommerce/includes/wc-product-functions.php:1083
    Stack trace:
    #0 /home2//wp-content/plugins/wpc-composite-products/wpc-composite-products.php(1565): wc_get_price_to_display(NULL, Array)
    #1 /home2/wp-includes/class-wp-hook.php(292): WPCleverWooco->wooco_get_cart_contents(Array)
    #2 /home2/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array)
    #3 /home2/wp-content/plugins/woocommerce/includes/class-wc-cart.php(140): apply_filters('woocommerce_get...', Array)
    #4 /home2/wp-content/plugins/woocommerce/includes/class-wc-cart.php(604): WC_Cart->get_cart_contents()
    #5 /home2/wp-content/plugins/woocommerce/includes/class-wc-cart.php(623): WC_Cart->get_cart()
    #6 /home2/wp-content/plugins/woocommerce/includes/class-wc-cart-session.php(213): WC_Car in /home2/wp-content/plugins/woocommerce/includes/wc-product-functions.php on line 1083
    

    From what I can see, the price of the product is not being translated? I’m only using the free plugin but if I need to upgrade, i’ll gladly do so.

    Thanks in advance!

    • This topic was modified 5 years, 3 months ago by b1naryc0d3.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi,

    When using WPML, our plugin doesn’t transfer components to other languages automatically. So, you need to search and add components and products in the right language manually.

    When creating composite products in the new language, please choose these options https://www.screencast.com/t/AGcAKDv0, it will copy all other settings.

    Thread Starter b1naryc0d3

    (@b1naryc0d3)

    Hi,
    I’ve added my product in french first and selected the options as shown in your screenshot. I translated the product to english and saved everything. I went back on the storefront and added the product when using the english site and it failed again with the same error.

    I’ve since purchased the plugin to get more details on this and opened a ticket as well.

    Hopefully I can get this fix soon. I was wondering why no sales were found using the english site!

    Thanks!

    Plugin Author WPClever

    (@wpclever)

    Yes! We’ll help you via our ticket system.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[WPML] Can’t add products when switching language’ is closed to new replies.