{"id":14556498,"date":"2021-06-15T02:19:47","date_gmt":"2021-06-15T02:19:47","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/cant-add-products-when-switching-language\/"},"modified":"2021-06-15T02:28:42","modified_gmt":"2021-06-15T02:28:42","slug":"cant-add-products-when-switching-language","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/cant-add-products-when-switching-language\/","title":{"rendered":"[WPML] Can&#8217;t add products when switching language"},"content":{"rendered":"<p>Hi there!<\/p>\n<p>Having a hard time trying to figure this out.<\/p>\n<p>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:<\/p>\n<pre><code>[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\nStack trace:\n#0 \/home2\/\/wp-content\/plugins\/wpc-composite-products\/wpc-composite-products.php(1565): wc_get_price_to_display(NULL, Array)\n#1 \/home2\/wp-includes\/class-wp-hook.php(292): WPCleverWooco-&gt;wooco_get_cart_contents(Array)\n#2 \/home2\/wp-includes\/plugin.php(212): WP_Hook-&gt;apply_filters(Array, Array)\n#3 \/home2\/wp-content\/plugins\/woocommerce\/includes\/class-wc-cart.php(140): apply_filters(&#039;woocommerce_get...&#039;, Array)\n#4 \/home2\/wp-content\/plugins\/woocommerce\/includes\/class-wc-cart.php(604): WC_Cart-&gt;get_cart_contents()\n#5 \/home2\/wp-content\/plugins\/woocommerce\/includes\/class-wc-cart.php(623): WC_Cart-&gt;get_cart()\n#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\n<\/code><\/pre>\n<p>From what I can see, the price of the product is not being translated? I&#8217;m only using the free plugin but if I need to upgrade, i&#8217;ll gladly do so.<\/p>\n<p>Thanks in advance!<\/p>\n","protected":false},"template":"","class_list":["post-14556498","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14556498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14556498\/revisions"}],"predecessor-version":[{"id":14556514,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14556498\/revisions\/14556514"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14556498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}