Title: Wishlist javascript error
Last modified: August 24, 2016

---

# Wishlist javascript error

 *  [ckunderd](https://wordpress.org/support/users/ckunderd/)
 * (@ckunderd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wishlist-javascript-error/)
 * Getting this error in my console when trying to work with quick view plugin from
   code canyon. Can’t add products to cart; add to cart function just lags.
 * jquery.yith-wcwl.js?ver=2.0:12 Uncaught TypeError: Cannot read property ‘closest’
   of undefined
 * when i deactivate wishlist, everything works fine.
 * [https://wordpress.org/plugins/yith-woocommerce-wishlist/](https://wordpress.org/plugins/yith-woocommerce-wishlist/)

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

 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wishlist-javascript-error/#post-6086952)
 * Hi ckunderd,
 * this is a strange issue! Maybe codecanyon quick view triggers wc “adding_to_cart”
   event missing required information.
 * Can you give us a link where to check for the problem?
 * Have a nice day 🙂
 *  [jay7134](https://wordpress.org/support/users/jay7134/)
 * (@jay7134)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wishlist-javascript-error/#post-6087064)
 * Hi Yithemes,
 * I have same issue when i try to add product using Quick view
 * Here is website url
 * [http://silktrader.weblicious.website/product-category/fashion-fabrics/](http://silktrader.weblicious.website/product-category/fashion-fabrics/)
 * Thanks
 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/wishlist-javascript-error/#post-6087065)
 * Hi jay7134,
 * I checked your installation, and found a little problem with woo_quick_view plugin:
   they’re triggering the adding_to_cart event without the two params, that by default
   are provided by woocommerce.
 * Maybe you can contact plugin developer, letting them know this little issue.
 * Anyway, I think we can learn by this problem, adding some additional check to
   the function that wishlist binds on adding_to_cart event.
 * We will implement this checks in the next plugin release; if you want to try 
   this solution by yourself, you can copy
 * _wp-content/plugins/yith-woocommerce-wishlist/assets/js/unminified/jquery.yith-
   wcwl.js_
 * and paste it in your theme root, renaming it as **wishlist.js**
 * Then, you’ll need to change line 32 of the file from this
 *     ```
       if( button.closest( '.wishlist_table' ).length != 0 ){
       ```
   
 * to this
 *     ```
       if( typeof button != 'undefined' && typeof data != 'undefined' && button.closest( '.wishlist_table' ).length != 0 ){
       ```
   
 * Let me know if this solves the problem
    Have a nice day 🙂

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

The topic ‘Wishlist javascript error’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-wishlist/assets/icon-128x128.gif?rev=3129302)
 * [YITH WooCommerce Wishlist](https://wordpress.org/plugins/yith-woocommerce-wishlist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-wishlist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/wishlist-javascript-error/#post-6087065)
 * Status: not resolved