Title: Important bug breaking extensions
Last modified: August 22, 2016

---

# Important bug breaking extensions

 *  Resolved [david_treblig](https://wordpress.org/support/users/david_treblig/)
 * (@david_treblig)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/important-bug-breaking-extensions/)
 * Hi!
 * I just wanted to let you (and others) know that the plugin currently breaks, 
   and has been breaking, support with some other extensions, the most popular one
   being woocommerce-smart-coupons.
 * Around lines 2537 to 2543 in products.class.php function woocommerce_calculate_totals():
   you can comment all the following lines to resolve the issue
 *     ```
       if(!is_null($tr_product_id)){
                       $cart_item_data = (array) apply_filters( 'woocommerce_add_cart_item_data', array(), $cart->cart_contents[$key]['product_id'], $cart->cart_contents[$key]['variation_id']);
                       $new_key = $woocommerce->cart->generate_cart_id( $cart->cart_contents[$key]['product_id'], $cart->cart_contents[$key]['variation_id'], $cart->cart_contents[$key]['variation'], $cart_item_data );
                       $cart->cart_contents = apply_filters('wcml_update_cart_contents_lang_switch',$cart->cart_contents,$key, $new_key,$current_language);
                       $new_cart_data[$new_key] = $cart->cart_contents[$key];
                       $new_cart_data = apply_filters('wcml_cart_contents', $new_cart_data, $cart->cart_contents,$key, $new_key);
                   }
   
       $cart->cart_contents = $new_cart_data;
       ```
   
 * The following lines seem to do absolutely nothing but generate a new cart ID 
   and WooCommerce doesn’t recognize the cart anymore and empties it // empties 
   the cart object associated to that ID. It might be a cross love/hate relationship
   between wpml, smart coupons and wpml multilingual, but I’ve pin pointed the bug
   to be that part since it seems to change absolutely nothing to generate a new
   id or not. Maybe it should be there?
 * Anyways, I hope this helps the many people I’ve seen having issues with both 
   plugins installed. And [@author](https://wordpress.org/support/users/author/):
   I would really like to hear what those few lines actually accomplish to know 
   if removing them is the real best solution.
 * Regards,
    David
 * [https://wordpress.org/plugins/woocommerce-multilingual/](https://wordpress.org/plugins/woocommerce-multilingual/)

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

 *  [Bernat Torras (a11n)](https://wordpress.org/support/users/bernattorras/)
 * (@bernattorras)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/important-bug-breaking-extensions/#post-5472273)
 * HI david_treblig,
 * Thanks for reporting the issue. We had no mentions about our compatibility with
   this plugin. I guess these lines are in fact important, as we recalculate cart
   ID’s often, as they need to change for each language (as the product id’s change
   as well). The issue is probably related to the filters (maybe smart coupons is
   applying some other filters with a different priority). Anyway, for the moment,
   you can keep your modifications if you’re experiencing no problems, but we’ll
   add this plugin to our compatibility list and contact the author to make them
   compatible. 🙂
 * Thanks for your report!
    Bernat
 *  Thread Starter [david_treblig](https://wordpress.org/support/users/david_treblig/)
 * (@david_treblig)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/important-bug-breaking-extensions/#post-5472283)
 * No problem!

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

The topic ‘Important bug breaking extensions’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-multilingual/assets/icon-256x256.png?rev=2937122)
 * [WPML Multilingual & Multicurrency for WooCommerce](https://wordpress.org/plugins/woocommerce-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-multilingual/reviews/)

## Tags

 * [breaking](https://wordpress.org/support/topic-tag/breaking/)
 * [smart](https://wordpress.org/support/topic-tag/smart/)
 * [WooCommerce Smart Coupons](https://wordpress.org/support/topic-tag/woocommerce-smart-coupons/)

 * 2 replies
 * 2 participants
 * Last reply from: [david_treblig](https://wordpress.org/support/users/david_treblig/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/important-bug-breaking-extensions/#post-5472283)
 * Status: resolved