Czarekplpl Posted November 24, 2015 Share Posted November 24, 2015 Hello. I got an error any time I try to add product to cart. Impossible to add the product to the cart. textStatus: 'parsererror' errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data' responseText: Notice: Undefined index: weight_attribute in /var/www/moja.domena.com/public_html/classes/Carrier.php on line 1389 {"products":[{"id":67,"link":"http:\/\/1cdeli.com.cn\/en\/sausages\/67-bratwurst-coarse-snail-230g-eco-pack-6957490109260.html","quantity":1,"image":"http:\/\/1cdeli.com.cn\/307-home_default\/bratwurst-coarse-snail-230g-eco-pack.jpg","image_cart":"http:\/\/1cdeli.com.cn\/307-cart_default\/bratwurst-coarse-snail-230g-eco-pack.jpg","priceByLine":"\u00a5 12.90","name":"BRATWURST COARSE SNAIL 230G ECO PACK","price":"\u00a5 12.90","price_float":12.9,"idCombination":0,"idAddressDelivery":0,"is_gift":false,"hasAttributes":false,"hasCustomizedDatas":false,"customizedDatas":[]}],"discounts":[],"shippingCost":"\u00a5 0.00","shippingCostFloat":0,"wrappingCost":"\u00a5 0.00","nbTotalProducts":1,"total":"\u00a5 12.90","productTotal":"\u00a5 12.90","freeShipping":"\u00a5 0.00","freeShippingFloat":0,"hasError":false,"crossSelling":false} Is anybody can help me to fix this issue? Link to comment Share on other sites More sharing options...
bitwise Posted November 26, 2015 Share Posted November 26, 2015 (edited) Hello. I got an error any time I try to add product to cart. Impossible to add the product to the cart. textStatus: 'parsererror' errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data' responseText: Notice: Undefined index: weight_attribute in /var/www/moja.domena.com/public_html/classes/Carrier.php on line 1389 {"products":[{"id":67,"link":"http:\/\/1cdeli.com.cn\/en\/sausages\/67-bratwurst-coarse-snail-230g-eco-pack-6957490109260.html","quantity":1,"image":"http:\/\/1cdeli.com.cn\/307-home_default\/bratwurst-coarse-snail-230g-eco-pack.jpg","image_cart":"http:\/\/1cdeli.com.cn\/307-cart_default\/bratwurst-coarse-snail-230g-eco-pack.jpg","priceByLine":"\u00a5 12.90","name":"BRATWURST COARSE SNAIL 230G ECO PACK","price":"\u00a5 12.90","price_float":12.9,"idCombination":0,"idAddressDelivery":0,"is_gift":false,"hasAttributes":false,"hasCustomizedDatas":false,"customizedDatas":[]}],"discounts":[],"shippingCost":"\u00a5 0.00","shippingCostFloat":0,"wrappingCost":"\u00a5 0.00","nbTotalProducts":1,"total":"\u00a5 12.90","productTotal":"\u00a5 12.90","freeShipping":"\u00a5 0.00","freeShippingFloat":0,"hasError":false,"crossSelling":false} Is anybody can help me to fix this issue? You must enter in Advanced Parameters -> Performance and on "Combinations" item, check Yes and Save. You will se that now you can add to cart. Similar to this, I have manualy changed the value to "false" on "PS_COMBINATION_FEATURE_ACTIVE", direct from phpMyAdmin in "configuration" table . Edited November 26, 2015 by bitwise (see edit history) 2 Link to comment Share on other sites More sharing options...
gu78 Posted December 2, 2015 Share Posted December 2, 2015 You must enter in Advanced Parameters -> Performance and on "Combinations" item, check Yes and Save. You will se that now you can add to cart. Similar to this, I have manualy changed the value to "false" on "PS_COMBINATION_FEATURE_ACTIVE", direct from phpMyAdmin in "configuration" table . On my database that parameter was null, I updated it to false and the error report dissapeared. Thanks for the clue. Link to comment Share on other sites More sharing options...
Czarekplpl Posted January 2, 2016 Author Share Posted January 2, 2016 It works for me. I got this problem today second time and problem gone when I set the Combination to Yes. First time I have a modified index.php it was one line from PhpMyBackup and this was a case of the error. Link to comment Share on other sites More sharing options...
Abbesnabb Posted March 24, 2016 Share Posted March 24, 2016 Wonderful, thank you so much. A switch from "null" to "false" in ps_configuration, PS_COMBINATION_FEATURE_ACTIVE totally saved the day. Link to comment Share on other sites More sharing options...
bu_marius Posted May 19, 2017 Share Posted May 19, 2017 Hello, better and the CORRECT way is to change the classes/Carrier.php on line 1389 from if ($cart_product['weight_attribute'] > 0) { to if (isset($cart_product['weight_attribute']) && $cart_product['weight_attribute'] > 0) { and like this you can disable Combinations for better performances regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now