YITH WooCommerce Wishlist - Version 3.0.7

Version Description

  • Released on 03 March 2020 =

  • New: support for WordPress 5.4

  • New: support for WooCommerce 4.0

  • New: improved checks on user capabilities

  • New: added wishlist widgets to Elementor

  • Update: plugin framework

  • Tweak: added check on user permission level for all wishlist actions

  • Tweak: escape output on templates

  • Fix: custom css not being loaded in the page

  • Fix: compatibility with YITH Infinite Scrolling when ajax loading is enabled

  • Fix: hide share section on wishlist page when "Share wishlist" option is disabled

  • Fix: assign correct css rule to border color for Wishlist Table

  • Dev: added yith_wcwl_reload_fragments trigger to refresh wishlist fragments

  • Dev: added yith_wcwl_remove_hidden_products_via_query filter

  • Dev: added yith_wcwl_show_add_to_wishlist filter, to allow dev selectively hide Add to Wishlist buttons

  • Dev: new actions on wishlist-view.php template (thanks to Jory)

  • Dev: added .editorconfig (thanks to Jory)

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Wishlist
Version 3.0.7
Comparing to
See all releases

Code changes from version 3.0.6 to 3.0.7

Files changed (42) hide show
  1. .editorconfig +26 -0
  2. README.md +98 -21
  3. README.txt +22 -3
  4. assets/css/style.css +1 -1
  5. assets/css/unminified/style.css +86 -4
  6. assets/js/jquery.yith-wcwl.js +1 -1
  7. assets/js/unminified/jquery.yith-wcwl.js +136 -13
  8. includes/class.yith-wcwl-admin.php +9 -9
  9. includes/class.yith-wcwl-ajax-handler.php +57 -59
  10. includes/class.yith-wcwl-frontend.php +661 -645
  11. includes/class.yith-wcwl-install.php +359 -357
  12. includes/class.yith-wcwl-shortcode.php +49 -8
  13. includes/class.yith-wcwl-wishlist.php +71 -5
  14. includes/class.yith-wcwl.php +769 -769
  15. includes/data-stores/class.yith-wcwl-wishlist-data-store.php +23 -14
  16. includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php +30 -6
  17. includes/functions.yith-wcwl.php +277 -251
  18. includes/widgets/elementor/class.yith-wcwl-elementor-add-to-wishlist.php +214 -0
  19. includes/widgets/elementor/class.yith-wcwl-elementor-wishlist.php +156 -0
  20. init.php +12 -12
  21. plugin-fw/assets/js/yit-plugin-panel.js +9 -0
  22. plugin-fw/assets/js/yit-plugin-panel.min.js +8 -1
  23. plugin-fw/init.php +2 -2
  24. plugin-fw/languages/yith-plugin-fw-el.mo +0 -0
  25. plugin-fw/languages/yith-plugin-fw-el.po +118 -89
  26. plugin-fw/lib/yit-plugin-panel-wc.php +24 -20
  27. plugin-fw/lib/yit-plugin-panel.php +8 -7
  28. plugin-fw/lib/yith-system-status.php +45 -39
  29. plugin-fw/templates/panel/panel-field-container.php +4 -2
  30. templates/add-to-wishlist-added.php +5 -5
  31. templates/add-to-wishlist-browse.php +20 -20
  32. templates/add-to-wishlist-button.php +21 -21
  33. templates/add-to-wishlist-remove.php +26 -26
  34. templates/add-to-wishlist.php +34 -34
  35. templates/share.php +67 -67
  36. templates/wishlist-view-footer-mobile.php +88 -88
  37. templates/wishlist-view-footer.php +87 -87
  38. templates/wishlist-view-header.php +19 -18
  39. templates/wishlist-view-mobile.php +232 -225
  40. templates/wishlist-view.php +300 -244
  41. templates/wishlist.php +3 -3
  42. uninstall.php +11 -11
.editorconfig ADDED
@@ -0,0 +1,26 @@
1
+ # This file is for unifying the coding style for different editors and IDEs
2
+ # editorconfig.org
3
+ # https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
4
+
5
+ # WordPress Coding Standards
6
+ # http://make.wordpress.org/core/handbook/coding-standards/
7
+
8
+ root = true
9
+
10
+ [*]
11
+ charset = utf-8
12
+ end_of_line = lf
13
+ indent_style = tab
14
+ indent_size = 4
15
+ tab_width = 4
16
+ insert_final_newline = true
17
+ trim_trailing_whitespace = true
18
+ # spaces_around_operators = true
19
+ # spaces_around_brackets = both
20
+
21
+ [*.txt]
22
+ trim_trailing_whitespace = false
23
+
24
+ [*.yml]
25
+ indent_style = space
26
+ indent_size = 2
README.md CHANGED
@@ -13,16 +13,64 @@ If you are not a developer, please, use the [YITH WooCommerce Wishlist plugin pa
13
14
## About plugin
15
16
- What can really make the difference in conversions and amount of sales is without a doubt the freedom to share your own wishlist, even on social networks, and increase indirect sales: can you imagine the sales volume you can generate during holidays or birthdays, when relatives and friends will be looking for the wishlist of your clients to buy a gift?
17
18
- OOffer to your visitors a chance to add the products of your WooCommerce store to a wishlist page. With YITH WooCommerce Wishlist you can add a link on each product detail page
19
- to add the products to the wishlist page. The plugin will create the specific page for you and the products will be added on this page. Afterwards, you will be able to add them to the cart or remove them.
20
21
## Getting started
22
23
* [Installation Guide](#quick-guide)
24
* [Languages](#available-languages)
25
* [Documentation](#documentation)
26
* [Changelog](#changelog)
27
* [Support](#support)
28
* [Reporting Security Issue](#reporting-security-issues)
@@ -70,27 +118,56 @@ You can find the official documentation of the plugin [here](https://docs.yithem
70
71
We're also working hard to release a developer guide; please, follow our [social channels](http://twitter.com/yithemes) to be informed about any update.
72
73
## Changelog
74
75
- ### 3.0.6 Released on 04 February 2020
76
-
77
- * Tweak: avoid redirect for guest users if wishlist page is set to my-account
78
- * Tweak: minor improvements to localization
79
- * Tweak: update wrong text domains
80
- * Tweak: changed default value for ATW icons
81
- * Tweak: set wishlist session cookie JIT
82
- * Tweak: use secure cookie for sessions, when possible (thanks to Ahmed)
83
- * Tweak: improved cache handling for get_default_wishlist method
84
- * Tweak: even if system cannot set session cookie, calculate session_id and use it for the entire execution
85
- * Update: Italian language
86
* Update: plugin framework
87
- * Fix: prevent error if list doesn't exists
88
- * Fix: issue with wishlist_id query param
89
- * Fix: items query now search for product in original language
90
- * Fix: returning correct wishlist and user id to yith_wcwl_added_to_wishlist and yith_wcwl_removed_from_wishlist actions (thanks to danielbitzer)
91
- * Fix: issue with default value for yith_wcwl_positions option
92
- * Fix: added key name to avoid DB error during install or update procedure
93
- * Dev: added yith_wcwl_shortcode_share_link_url filter
94
95
## Support
96
13
14
## About plugin
15
16
+ The wishlist is one of the most powerful and popular tools in an ecommerce shop. Thanks to the wishlist, users can:
17
18
+ * Save their favourite products, find them quickly and easily at a later time and buy them.
19
+ * Share the wishlist with relatives and friends for Christmas, birthdays and similar occasions so they can buy them one of the products from the list.
20
+ * Share the wishlist on social networks and get indirect advertising for your store.
21
+
22
+ This means that you’ll be able to loyalise customers, push them to buy and attract new customers any time a wishlist is shared. Not bad for one plugin only, don’t you think?
23
+
24
+ Our YITH WooCommerce Wishlist has more than **700,000 active installations** and that’s why it’s **the most popular wishlist plugin ever.**
25
+
26
+ To celebrate this record and say thanks to all the plugin users, we’ve decided to release a new 3.0 version that has improved the design tremendously and added many new options.
27
+
28
+ **If you like the new design, please, [leave a review](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/reviews/#new-post) to help the plugin grow!**
29
+
30
+ [Free version live demo >](https://plugins.yithemes.com/yith-woocommerce-wishlist-free/)
31
+ [Documentation >](https://docs.yithemes.com/yith-woocommerce-wishlist)
32
+
33
+ ### Basic features
34
+
35
+ * Select a page for your wishlist
36
+ * Select where to show the shortcode ‘Add to wishlist’
37
+ * Show the ‘Remove from wishlist’ button when the product is in the Wishlist
38
+ * Show the ‘Add to wishlist’ button also on the Shop page
39
+ * Customise columns that will be displayed in the wishlist table
40
+ * Product variation support (if the user selects a specific color or size and then adds it to the wishlist, this details will be saved)
41
+
42
+ ### Premium features
43
+
44
+ [Premium version live demo >](https://plugins.yithemes.com/yith-woocommerce-wishlist/)
45
+
46
+ The free version of our plugin works like a charm, but the premium one is an even more powerful tool to increase sales and conversions. By upgrading to the premium version, you can:
47
+
48
+ * View the wishlists created by logged-in customers
49
+ * View a list of popular products (added to wishlists)
50
+ * Send promotionals email to users who have added a specific product to their wishlist
51
+ * Show the ‘Ask for an estimate’ button to let customers send the content of their wishlist to the admin and get a quotation
52
+ * Add optional notes to the quote request
53
+ * Enable/disable the wishlist features for unlogged users
54
+ * Show a notice to unlogged users: invite them to log in to benefit from all the wishlist functionalities
55
+ * Allow users to create as many wishlists as they want
56
+ * Allow users to manage wishlists, rename and delete them, add or remove items
57
+ * Allow users to search and see registered wishlists
58
+ * Allow users to set visibility options for each wishlist, by making them either public (visible to everyone), private (visible to the owner only) or shared (visible only to people it has been shared with)
59
+ * Show multiple ‘Add to Cart’ buttons in the wishlist table
60
+ * Show product price variations (Amazon style)
61
+ * Allow users to move an element from one wishlist to another, right from the wishlist table
62
+ * Allow users to drag and drop products to arrange their order in the wishlist
63
+ * Choose modern & beautiful layouts for the wishlist page and tables
64
+ * Provide your customers with nice widgets to help them find their wishlist quickly and easily.
65
+
66
+ [GET THE PREMIUM VERSION HERE with a 100% Money Back guarantee >](https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/)
67
68
## Getting started
69
70
* [Installation Guide](#quick-guide)
71
* [Languages](#available-languages)
72
* [Documentation](#documentation)
73
+ * [FAQ](#faq)
74
* [Changelog](#changelog)
75
* [Support](#support)
76
* [Reporting Security Issue](#reporting-security-issues)
118
119
We're also working hard to release a developer guide; please, follow our [social channels](http://twitter.com/yithemes) to be informed about any update.
120
121
+ ## FAQ
122
+
123
+ **Does YITH WooCommerce Wishlist allows adding an “add to wishlist” button on the products on shop page and archive pages?**
124
+
125
+ Yes, from version 3.0 the plugin also allows showing the Add to wishlist button on your **shop page, category pages, product shortcodes, product sliders,** and all the other places where the WooCommerce products’ loop is used.
126
+
127
+ **Can I customize the wishlist page?**
128
+
129
+ Yes, the page is a simple template and you can override it by putting the file template "wishlist.php" inside the "woocommerce" folder of the theme folder.
130
+
131
+ **Can I move the position of "Add to wishlist" button?**
132
+
133
+ Yes, you can move the button to another default position or you can also use the shortcode inside your theme code.
134
+
135
+ **Can I change the style of "Add to wishlist" button?**
136
+
137
+ Yes, you can change the colors of background, text and border or apply a custom css. You can also use a link or a button for the "Add to wishlist" feature.
138
+
139
+ **Wishlist page returns a 404 error?**
140
+
141
+ Try to regenerate permalinks from Settings -> Permalinks by simply saving them again.
142
+
143
+ **Have you encountered anomalies after plugin update, that did not exist in the previous version?**
144
+
145
+ This might depend on the fact that your theme overrides plugin templates. Check if the developer of your theme has released a compatibility update with version 3.0 or later of YITH WooCommerce Wishlist. As an alternative you can try the plugin in WordPress default theme to leave out any possible influences by the theme.
146
+
147
+ **I am currently using Wishlist plugin with Catalog Mode enabled in my site. Prices for products should disappear, yet they still appear in the wishlist page. Can I remove them?**
148
+
149
+ Yes, of course you can. To avoid Wishlist page to show product prices, you can hide price column from wishlist table. Go to YITH -> Wishlist -> Wishlist Page Options and disable option "Product price".
150
+
151
## Changelog
152
153
+ ### 3.0.7 - Released on 03 March 2020
154
+
155
+ * New: support for WordPress 5.4
156
+ * New: support for WooCommerce 4.0
157
+ * New: improved checks on user capabilities
158
+ * New: added wishlist widgets to Elementor
159
* Update: plugin framework
160
+ * Tweak: added check on user permission level for all wishlist actions
161
+ * Tweak: escape output on templates
162
+ * Fix: custom css not being loaded in the page
163
+ * Fix: compatibility with YITH Infinite Scrolling when ajax loading is enabled
164
+ * Fix: hide share section on wishlist page when "Share wishlist" option is disabled
165
+ * Fix: assign correct css rule to border color for Wishlist Table
166
+ * Dev: added yith_wcwl_reload_fragments trigger to refresh wishlist fragments
167
+ * Dev: added yith_wcwl_remove_hidden_products_via_query filter
168
+ * Dev: added yith_wcwl_show_add_to_wishlist filter, to allow dev selectively hide Add to Wishlist buttons
169
+ * Dev: new actions on wishlist-view.php template (thanks to Jory)
170
+ * Dev: added .editorconfig (thanks to Jory)
171
172
## Support
173
README.txt CHANGED
@@ -3,13 +3,13 @@
3
Contributors: yithemes
4
Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
5
Requires at least: 4.0
6
- Tested up to: 5.3
7
- Stable tag: 3.0.6
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11
YITH WooCommerce Wishlist add all Wishlist features to your website. Needs WooCommerce to work.
12
- WooCommerce 3.9.x compatible.
13
14
== Description ==
15
@@ -112,6 +112,25 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h
112
113
== Changelog ==
114
115
= 3.0.6 – Released on 04 February 2020 =
116
117
* Tweak: avoid redirect for guest users if wishlist page is set to my-account
3
Contributors: yithemes
4
Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
5
Requires at least: 4.0
6
+ Tested up to: 5.4
7
+ Stable tag: 3.0.7
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11
YITH WooCommerce Wishlist add all Wishlist features to your website. Needs WooCommerce to work.
12
+ WooCommerce 4.0.x compatible.
13
14
== Description ==
15
112
113
== Changelog ==
114
115
+ = 3.0.7 - Released on 03 March 2020 =
116
+
117
+ * New: support for WordPress 5.4
118
+ * New: support for WooCommerce 4.0
119
+ * New: improved checks on user capabilities
120
+ * New: added wishlist widgets to Elementor
121
+ * Update: plugin framework
122
+ * Tweak: added check on user permission level for all wishlist actions
123
+ * Tweak: escape output on templates
124
+ * Fix: custom css not being loaded in the page
125
+ * Fix: compatibility with YITH Infinite Scrolling when ajax loading is enabled
126
+ * Fix: hide share section on wishlist page when "Share wishlist" option is disabled
127
+ * Fix: assign correct css rule to border color for Wishlist Table
128
+ * Dev: added yith_wcwl_reload_fragments trigger to refresh wishlist fragments
129
+ * Dev: added yith_wcwl_remove_hidden_products_via_query filter
130
+ * Dev: added yith_wcwl_show_add_to_wishlist filter, to allow dev selectively hide Add to Wishlist buttons
131
+ * Dev: new actions on wishlist-view.php template (thanks to Jory)
132
+ * Dev: added .editorconfig (thanks to Jory)
133
+
134
= 3.0.6 – Released on 04 February 2020 =
135
136
* Tweak: avoid redirect for guest users if wishlist page is set to my-account
assets/css/style.css CHANGED
@@ -1 +1 @@
1
- .woocommerce a.selectBox{background:#fff;min-width:100px;margin-right:10px;color:inherit}.woocommerce a.selectBox,.woocommerce a.selectBox:hover{border-bottom:1px solid #bbb!important}.woocommerce a.selectBox:hover{color:inherit}.woocommerce a.selectBox:focus{border:1px solid #ccc}.selectBox-dropdown .selectBox-label{vertical-align:middle;padding:3px 8px}.selectBox-dropdown .selectBox-arrow{border:none;background:url(../images/jquery.selectBox-arrow.png) center right no-repeat}.selectBox-dropdown.selectBox-menuShowing .selectBox-arrow{background:url(../images/jquery.selectBox-arrow.png) center left no-repeat}.selectBox-dropdown-menu{border-bottom-left-radius:3px;border-bottom-right-radius:3px;padding:5px;font-size:80%}.selectBox-dropdown-menu li a{color:inherit;padding:5px 8px;border-radius:3px}.selectBox-dropdown-menu a:hover{color:inherit;text-decoration:none}select.selectBox.change-wishlist{max-width:100px}.selectBox.change-wishlist{width:auto!important}.change-wishlist-selectBox-dropdown-menu{width:auto!important}.yith-wcwl-with-pretty-photo{overflow:hidden}.woocommerce .wishlist-fragment .blockUI.blockOverlay::before,.woocommerce .yith-wcwl-popup-form .blockUI.blockOverlay::before{display:none}.yith-wcwl-popup{display:none}.yith-wcwl-popup-content h3{text-align:center;font-size:1.5em}.yith-wcwl-popup-content .heading-icon,.yith-wcwl-popup-feedback .heading-icon{text-align:center;display:block;font-size:70px;color:#333;margin-bottom:15px}.yith-wcwl-popup-content .popup-description{text-align:center;font-weight:600;margin-bottom:15px}.yith-wcwl-popup-content .popup-description a.show-tab.active{cursor:inherit;color:inherit;pointer-events:none}.yith-wcwl-popup-feedback p.feedback{margin-top:1.5em;text-align:center;font-size:1.1rem;font-weight:600}.yith-wcwl-popup-content label{display:block}.yith-wcwl-popup-content input[type=text],.yith-wcwl-popup-content select{padding:10px 7px}.yith-wcwl-popup-content .create{display:none}.yith-wcwl-popup-content .yith-wcwl-second-row{display:none}.yith-wcwl-popup-footer{margin-top:15px}.yith-wcwl-popup-footer .button.wishlist-submit{display:block;width:100%;text-align:center}.pp_pic_holder.pp_woocommerce.feedback{max-width:450px!important}.pp_pic_holder.pp_woocommerce.feedback .pp_content{width:auto!important}.yith-wcwl-popup-feedback{margin-top:2em;margin-bottom:2em}.yith-wcwl-add-button.with-dropdown{position:relative;padding:15px 0}.yes-js .yith-wcwl-add-button ul.yith-wcwl-dropdown{display:none;list-style:none;margin-bottom:0;padding:5px 25px;border:1px solid #cdcdcd;background:#fff;position:absolute;z-index:15;top:calc(100% - 5px);min-width:200px}.yith-wcwl-add-button.show-dropdown ul.yith-wcwl-dropdown{display:block}.yith-wcwl-add-button ul.yith-wcwl-dropdown li{padding:15px;padding-left:0;text-transform:uppercase;font-size:.8em}.yith-wcwl-add-button ul.yith-wcwl-dropdown li a{font-size:1em!important;color:inherit;box-shadow:none}.yith-wcwl-add-button ul.yith-wcwl-dropdown li a:hover{color:initial}.yith-wcwl-add-button ul.yith-wcwl-dropdown li:before{font-family:FontAwesome;content:'\f067';margin-right:15px}.yith-wcwl-add-button ul.yith-wcwl-dropdown li:not(:last-child){border-bottom:1px solid #cdcdcd}.yith-wcwl-add-to-wishlist .separator+[data-title]{display:inline-block}.yith-wcwl-add-to-wishlist .with-tooltip{position:relative}.yith-wcwl-tooltip{z-index:10;padding:5px 10px;border-radius:5px;text-align:center;top:calc(100% + 5px);pointer-events:none;cursor:initial;font-size:.6875rem;line-height:normal;display:none}.with-dropdown .yith-wcwl-tooltip{top:auto;bottom:calc(100% + 10px)}.with-tooltip .yith-wcwl-tooltip{position:absolute}.with-tooltip .yith-wcwl-tooltip:before{content:'';display:block;position:absolute;top:-5px;left:calc(50% - 2px);width:0;height:0;background:0 0!important;border-left:5px solid transparent!important;border-right:5px solid transparent!important;border-bottom:5px solid}.with-dropdown .with-tooltip .yith-wcwl-tooltip:before{bottom:-5px;top:auto;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;border-bottom:none}#yith-wcwl-popup-message{font-weight:700;line-height:50px;text-align:center;background:#fff;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3);position:fixed;top:50%;left:50%;padding:7px 40px;z-index:10000}.wishlist-title{display:inline-block}.wishlist-title h2{display:inline-block;padding:5px}.wishlist-title.wishlist-title-with-form h2:hover{background:#efefef}.wishlist-title a.show-title-form{cursor:pointer;visibility:hidden}.wishlist-title:hover a.show-title-form{visibility:visible}.yes-js #yith-wcwl-form .hidden-title-form{display:none;margin:25px 0 39px}table.wishlist_table{font-size:80%}table.wishlist_table tr{position:relative}table.wishlist_table thead th{border-top:1px solid;padding:16px 12px}table.wishlist_table tbody td{padding:16px 12px}table.wishlist_table tbody td,table.wishlist_table thead th{border-color:#e7e7e7}.wishlist_table tr td,.wishlist_table tr th.product-checkbox,.wishlist_table tr th.wishlist-delete{text-align:center;background:#fff}.wishlist_table tr th.product-checkbox{vertical-align:middle;width:40px}.wishlist_table tr th.product-remove{vertical-align:middle;width:40px}.wishlist_table tr th.product-thumbnail{width:80px}.wishlist_table tfoot td,.wishlist_table tr td.product-name,.wishlist_table tr td.product-thumbnail,.wishlist_table tr td.wishlist-name,.wishlist_table tr td.wishlist-privacy{text-align:left}.wishlist_table tr td.product-remove{padding:16px 0}.wishlist_table tr td.product-thumbnail a{display:block;border:none;max-width:80px}.wishlist_table tr td.product-thumbnail a img{width:100%}.wishlist_table tr td.product-arrange{cursor:grab}.wishlist_table tr td.product-arrange:active{cursor:grabbing}.wishlist_table .product-stock-status span.wishlist-in-stock{color:#297e29}.wishlist_table .product-stock-status span.wishlist-out-of-stock{color:red}.wishlist_table .product-add-to-cart span.dateadded{display:block}.wishlist_table .product-add-to-cart a{display:table!important;margin:0 auto 5px!important;text-align:center}.wishlist_table .product-add-to-cart a.button{padding:6px 25px!important}.wishlist_table .product-add-to-cart a>img{display:inline;max-width:2em}.wishlist_table .price-variation{display:block}.wishlist_table .price-variation.decrease .variation-rate{color:red}.wishlist_table .price-variation .old-price{display:block}.wishlist_table a.button{white-space:normal;margin-bottom:5px!important}.wishlist_table.modern_grid{list-style:none;margin:0 -7px 35px;font-size:0}.wishlist_table.modern_grid li{display:inline-block;vertical-align:top;width:33.33%;padding:0 7px;margin-bottom:15px}.wishlist_table.images_grid li.wishlist-empty,.wishlist_table.modern_grid li.wishlist-empty{width:100%;font-size:1rem}.wishlist_table.images_grid li.show{z-index:10}.wishlist_table.modern_grid li .item-wrapper{display:table;margin:0 -7px}.wishlist_table.modern_grid li .item-details,.wishlist_table.modern_grid li .product-thumbnail{display:table-cell;vertical-align:top;box-sizing:border-box;width:50%;padding:0 7px;font-size:1rem}.wishlist_table.images_grid li .product-thumbnail,.wishlist_table.modern_grid li .product-thumbnail{position:relative}.wishlist_table.images_grid li .product-thumbnail .product-checkbox,.wishlist_table.modern_grid li .product-thumbnail .product-checkbox{position:absolute;top:7px;left:15px;z-index:2}.wishlist_table.modern_grid li .product-thumbnail>a{display:block}.wishlist_table.modern_grid li .product-thumbnail>a img{display:block}.wishlist_table.images_grid li.show .product-thumbnail>a img,.wishlist_table.images_grid li:hover .product-thumbnail>a img{filter:brightness(1.1)}.wishlist_table.modern_grid.wishlist_view li .item-details{position:relative}.wishlist_table.modern_grid.wishlist_view li .item-details:before{content:'';display:block;top:0;bottom:0;left:7px;background:#fff;position:absolute;right:7px;z-index:0;border:1px solid #cdcdcd}.wishlist_table.images_grid li .item-details{display:none;position:absolute;z-index:2;bottom:15px;left:calc(50% - 150px);width:300px;background:#fff;padding:10px 20px;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3)}.wishlist_table.images_grid li.show .item-details{display:block}.wishlist_table.modern_grid li .item-details .item-details-wrapper{padding:15px 20px;line-height:normal;position:relative}.wishlist_table.images_grid li .item-details a.close{position:absolute;top:10px;right:20px}.wishlist_table.images_grid li .item-details h3,.wishlist_table.mobile li .item-details h3,.wishlist_table.modern_grid li .item-details h3{margin-bottom:7px}.wishlist_table.images_grid li .item-details table.item-details-table,.wishlist_table.mobile li .item-details table.item-details-table,.wishlist_table.mobile li table.additional-info,.wishlist_table.modern_grid li .item-details table.item-details-table{border:none;margin-bottom:7px}.wishlist_table.images_grid li .item-details table.item-details-table td,.wishlist_table.mobile li .item-details table.item-details-table td,.wishlist_table.mobile li table.additional-info td,.wishlist_table.modern_grid li .item-details table.item-details-table td{border:none;font-size:.7em;padding:3px;vertical-align:top}.wishlist_table.images_grid li .item-details table.item-details-table td.label,.wishlist_table.mobile li .item-details table.item-details-table td.label,.wishlist_table.mobile li table.additional-info td.label,.wishlist_table.modern_grid li .item-details table.item-details-table td.label{text-align:left;font-weight:700;width:40%}.wishlist_table.images_grid li .item-details table.item-details-table td.value,.wishlist_table.mobile li .item-details table.item-details-table td.value,.wishlist_table.mobile li table.additional-info td.value,.wishlist_table.modern_grid li .item-details table.item-details-table td.value{text-align:right}.wishlist_table.modern_grid li .item-details table.item-details-table td.value a.selectBox{margin-right:0}.wishlist_table.images_grid li .item-details table.item-details-table td.value input,.wishlist_table.mobile li table.additional-info td.value input,.wishlist_table.modern_grid li .item-details table.item-details-table td.value input{width:auto}.wishlist_table.images_grid li .item-details .product-add-to-cart,.wishlist_table.modern_grid li .item-details .product-add-to-cart{text-align:center;margin-bottom:7px}.wishlist_table.images_grid li .item-details .move-to-another-wishlist,.wishlist_table.modern_grid li .item-details .move-to-another-wishlist{text-align:center;margin-bottom:7px}.wishlist_table.images_grid li .item-details .product-remove,.wishlist_table.modern_grid li .item-details .product-remove{text-align:right}.wishlist_table.images_grid li .item-details .product-remove a,.wishlist_table.modern_grid li .item-details .product-remove a{border:none;border-radius:0;display:inline-block}.wishlist_table.mobile{list-style:none;margin-left:0}.wishlist_table.mobile li{margin-bottom:7px}.wishlist_table.mobile li .product-checkbox{display:inline-block;width:20px;vertical-align:top}.wishlist_table.mobile li .item-wrapper{display:inline-block;width:calc(100% - 25px);vertical-align:top;margin-bottom:7px}.wishlist_table.wishlist_manage_table.mobile li .item-wrapper{width:100%}.wishlist_table.mobile li .item-wrapper .product-thumbnail{display:inline-block;max-width:60px;margin-right:10px}.wishlist_table.mobile li .item-wrapper .item-details{display:inline-block;width:calc(100% - 80px);vertical-align:top}.wishlist_table.mobile.with-checkbox li .additional-info-wrapper{padding-left:20px}.wishlist_table.mobile li .additional-info-wrapper .move-to-another-wishlist,.wishlist_table.mobile li .additional-info-wrapper .product-add-to-cart{text-align:center;margin-bottom:7px}.wishlist_table.mobile li .additional-info-wrapper .product-remove{text-align:right}a.add_to_wishlist{cursor:pointer}.yith-wcwl-add-to-wishlist .feedback .yith-wcwl-icon{margin-right:5px}.yith-wcwl-add-to-wishlist a.add_to_wishlist>img,.yith-wcwl-add-to-wishlist a.delete_item>img,.yith-wcwl-add-to-wishlist a.move_to_another_wishlist>img{max-width:32px;display:inline-block;margin-right:10px}a.add_to_wishlist+a.view-wishlist,a.delete_item+a.view-wishlist{margin-left:15px}.summary .single_add_to_wishlist.button,div.product .woocommerce-price-and-add .single_add_to_wishlist.button{margin:0}.wishlist_table .add_to_cart.button{padding:7px 12px;line-height:normal}.yith-wcwl-add-to-wishlist{margin-top:10px}.hidden-title-form a.hide-title-form i,.hidden-title-form button i,.wishlist-title a.show-title-form i,.wishlist_manage_table tfoot a.create-new-wishlist i,.wishlist_manage_table tfoot button.submit-wishlist-changes i,.wishlist_table .add_to_cart.button i,.wishlist_table .ask-an-estimate-button i,.yith-wcwl-add-button>a i,.yith-wcwl-wishlist-new button i,.yith-wcwl-wishlist-search-form button.wishlist-search-button i{margin-right:10px}.hidden-title-form a.hide-title-form,.wishlist-title a.show-title-form,.wishlist_manage_table a.create-new-wishlist,.wishlist_manage_table button.submit-wishlist-changes,.wishlist_table .add_to_cart.button,.wishlist_table a.ask-an-estimate-button,.woocommerce .yith-wcwl-wishlist-new button,.yith-wcwl-add-button a.add_to_wishlist,.yith-wcwl-popup-button a.add_to_wishlist,.yith-wcwl-wishlist-search-form button.wishlist-search-button{margin:0;box-shadow:none;text-shadow:none}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist{position:absolute;z-index:10;margin:0;top:10px;left:10px}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .with-dropdown{padding:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .add_to_wishlist,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .disabled_item,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .open-pretty-photo{font-size:0;background:0 0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .delete_item,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .move_to_another_wishlist{font-size:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .feedback{display:none}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .feedback+a{font-size:0;background:0 0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist i{font-size:1.6rem;margin:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist img{margin:0}.woocommerce .wishlist-title{margin-bottom:30px}.woocommerce .wishlist-title h2{vertical-align:middle;margin-bottom:0}.woocommerce .hidden-title-form button{padding:7px 24px;vertical-align:middle;border:none;position:relative}.woocommerce .hidden-title-form button:active{top:1px}.woocommerce .hidden-title-form a.hide-title-form{vertical-align:middle;line-height:normal}.woocommerce .back-to-all-wishlists{margin-bottom:20px}.woocommerce #content table.wishlist_table.cart a.remove{color:#c3c3c3;margin:0 auto}.woocommerce #content table.wishlist_table.cart a.remove:hover{background-color:#c3c3c3;color:#fff}.yith-wcwl-share{margin-bottom:35px}.yith-wcwl-share h4.yith-wcwl-share-title{margin:10px 0}.yith-wcwl-share ul{margin:5px 0;padding:0}.entry-content .yith-wcwl-share ul li,.yith-wcwl-share ul li{display:inline-block;margin-left:0;margin-right:0}.yith-wcwl-share li a{color:#fff;text-align:center;text-decoration:none;line-height:1;padding:5px;display:block;border:none;min-width:26px;min-height:26px}.yith-wcwl-share li a:hover{color:#fff}.yith-wcwl-share li a>img{max-width:1em}.copy-trigger{cursor:pointer}.woocommerce .ask-an-estimate-button>img{max-width:1em;display:inline;margin-right:5px}#ask_an_estimate_popup{display:none}.wishlist-ask-an-estimate-popup .ask-an-estimate-button-popup{width:100%}.wishlist-ask-an-estimate-popup .woocommerce-error{margin-bottom:0}.wishlist-ask-an-estimate-popup #additional_notes{min-height:150px}.ask-an-estimate-confirmation{padding:0 30px;text-align:center}.yith_wcwl_wishlist_footer>div{margin-bottom:15px}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_bulk_action{float:left}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_bulk_action #bulk_actions{min-width:250px}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_update{float:right}.yith_wcwl_wishlist_footer .yith-wcwl-share{float:left;clear:both}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action{float:right}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action>*{vertical-align:middle}.yith_wcwl_wishlist_update+.yith_wcwl_footer_additional_action{clear:both}.wishlist-page-links{clear:both}#move_to_another_wishlist{display:none}.yith-wcwl-wishlist-new{padding:20px 0}.yith-wcwl-popup-content .yith-wcwl-wishlist-new{padding:0}.yith-wcwl-wishlist-new .wishlist-name{display:inline-block}.yith-wcwl-wishlist-new .wishlist-privacy-radio label{display:block}.yith-wcwl-popup-content .create-wishlist-button{margin-top:15px;width:100%}#create_new_wishlist{display:none}.wishlist_manage_table select{vertical-align:middle;margin-right:10px}.wishlist_manage_table td.wishlist-name .wishlist-title{margin-bottom:0}.wishlist_manage_table td.wishlist-name .hidden-title-form{margin:0!important}.wishlist_manage_table td.wishlist-name .hidden-title-form input[type=text]{width:100%;min-width:0}table.wishlist_manage_table tfoot td{text-align:right;padding:24px 12px}.wishlist_manage_table tfoot button.submit-wishlist-changes{padding:7px 24px;vertical-align:middle;border:1px solid;border-radius:3px;position:relative;line-height:normal}.wishlist_manage_table tfoot button.submit-wishlist-changes:active{top:1px}.wishlist_manage_table tfoot a.create-new-wishlist{vertical-align:middle;line-height:normal;padding:7px 24px}.wishlist_manage_table.modern_grid li .item-wrapper{display:block;margin:0;padding:40px 50px;background:#fff;border:1px solid #cdcdcd}.wishlist_manage_table.modern_grid li .item-details,.wishlist_manage_table.modern_grid li .product-thumbnail{display:block;width:100%;padding:0}.wishlist_manage_table.modern_grid li .product-thumbnail img:first-child{width:100%;margin-bottom:15px}.wishlist_manage_table.modern_grid li .product-thumbnail img{width:calc(50% - 8px)}.wishlist_manage_table.modern_grid li .product-thumbnail img:nth-child(3){margin-left:15px}.wishlist_manage_table.modern_grid li .wishlist-title-with-form{display:block}.wishlist_manage_table.modern_grid li .wishlist-title-with-form h3{display:inline-block}.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form,.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form:hover{visibility:visible;float:right;margin:0;background:0 0;color:inherit}.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form i{margin:0}.wishlist_manage_table.modern_grid li .hidden-title-form{margin-top:0!important}.wishlist_manage_table.modern_grid li .hidden-title-form input[type=text]{width:100%;min-width:0}.wishlist_manage_table.mobile li{margin-bottom:30px}.wishlist_manage_table.mobile li .item-wrapper .item-details{width:100%}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form{display:block;border-bottom:1px solid #cdcdcd;position:relative}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form a.show-title-form{position:absolute;right:0;top:0;visibility:visible}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form a.show-title-form i{margin-right:0}.wishlist_manage_table.mobile li .item-details table.item-details-table td.value a.selectBox{margin-right:0}.wishlist_manage_table.mobile li .item-details table.item-details-table td.value a.wishlist-download{float:left}.yith-wcwl-wishlist-search-form{text-align:center;padding:20px 0}.yith-wcwl-wishlist-search-form #wishlist_search{display:inline-block;max-width:300px;vertical-align:middle}.yith-wcwl-wishlist-search-form button.wishlist-search-button{display:inline-block;padding:7px 24px;vertical-align:middle;border:1px solid;border-radius:3px;position:relative;line-height:normal}.yith-wcwl-wishlist-search-form button.wishlist-search-button i{margin:0}.yith-wcwl-wishlist-search-form button.wishlist-search-button:active{top:1px}.yith-wcwl-search-results .wishlist-owner{text-align:left}.yith-wcwl-search-results .wishlist-owner .thumb{display:inline-block;margin-right:15px}.yith-wcwl-add-to-wishlist .ajax-loading{box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important;display:inline!important;margin-left:5px;vertical-align:middle;visibility:hidden;width:16px!important;height:16px!important}.widget_yith-wcwl-lists ul.dropdown li{padding:0}.widget_yith-wcwl-lists ul.dropdown ul.lists>li a,.widget_yith-wcwl-lists ul.dropdown>li a{display:block;padding:5px 15px}.widget_yith-wcwl-lists ul.dropdown ul.lists>li a{padding:5px 25px}.widget_yith-wcwl-lists ul.dropdown>li.lists-section{border-bottom:1px solid #e7e7e7}.widget_yith-wcwl-lists ul.dropdown ul.lists{margin:0}.widget_yith-wcwl-items .mini{position:relative}.widget_yith-wcwl-items .heading{text-align:center;cursor:pointer}.widget_yith-wcwl-items .mini .heading{display:inline-block}.widget_yith-wcwl-items .heading a{color:inherit}.widget_yith-wcwl-items .extended .heading .items-counter{position:relative}.widget_yith-wcwl-items .extended .heading .items-counter i{font-size:70px;position:relative;margin-bottom:10px}.widget_yith-wcwl-items .mini .heading .items-counter i{font-size:30px}.widget_yith-wcwl-items .extended .heading .items-counter .items-count{display:block;position:absolute;left:0;right:0;text-align:center;top:calc(50% - 20px);font-size:1rem}.widget_yith-wcwl-items .mini .heading .items-counter .items-count{font-size:1rem}.widget_yith-wcwl-items .extended .heading h3:after{content:'';display:block;max-width:80px;border-bottom:1px solid #cdcdcd;margin:10px auto}.widget_yith-wcwl-items .mini .list{position:absolute;z-index:1;left:0;background:#fff;padding:25px 40px;display:none;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3)}.widget_yith-wcwl-items .mini:hover .list{display:block}.widget_yith-wcwl-items ul.product_list_widget{margin-bottom:40px!important}.widget_yith-wcwl-items p.empty-wishlist{margin-bottom:0!important}.widget_yith-wcwl-items .mini ul.product_list_widget{margin-left:-20px}.widget_yith-wcwl-items ul.product_list_widget li{display:table}.widget_yith-wcwl-items ul.product_list_widget li:not(:last-child){margin-bottom:10px}.widget_yith-wcwl-items ul.product_list_widget li .image-thumb,.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info,.widget_yith-wcwl-items ul.product_list_widget li .remove_from_all_wishlists{display:table-cell;vertical-align:middle}.widget_yith-wcwl-items ul.product_list_widget li .remove_from_all_wishlists{font-size:1.2rem}.widget_yith-wcwl-items ul.product_list_widget li .image-thumb img{margin-left:10px;max-width:40px}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info{display:inline-block;vertical-align:middle;margin-left:10px}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info a{display:inline-block}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info>*{display:block}.widget_yith-wcwl-items .show-wishlist,.widget_yith-wcwl-items a.add_all_to_cart{display:block!important}.widget_yith-wcwl-items .show-wishlist{margin-bottom:10px}.widget_yith-wcwl-items a.add_all_to_cart{text-align:center}@media(max-width:768px){.yith_wcwl_wishlist_bulk_action select{width:100%;margin-bottom:15px}.yith_wcwl_wishlist_bulk_action input{float:right}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action{float:none}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action .ask-an-estimate-button{width:100%;text-align:center}}
1
+ .woocommerce a.selectBox{background:#fff;min-width:100px;margin-right:10px;color:inherit}.woocommerce a.selectBox,.woocommerce a.selectBox:hover{border-bottom:1px solid #bbb!important}.woocommerce a.selectBox:hover{color:inherit}.woocommerce a.selectBox:focus{border:1px solid #ccc}.selectBox-dropdown .selectBox-label{vertical-align:middle;padding:3px 8px}.selectBox-dropdown .selectBox-arrow{border:none;background:url(../images/jquery.selectBox-arrow.png) center right no-repeat}.selectBox-dropdown.selectBox-menuShowing .selectBox-arrow{background:url(../images/jquery.selectBox-arrow.png) center left no-repeat}.selectBox-dropdown-menu{border-bottom-left-radius:3px;border-bottom-right-radius:3px;padding:5px;font-size:80%}.selectBox-dropdown-menu li a{color:inherit;padding:5px 8px;border-radius:3px}.selectBox-dropdown-menu a:hover{color:inherit;text-decoration:none}select.selectBox.change-wishlist{max-width:100px}.selectBox.change-wishlist{width:auto!important}.change-wishlist-selectBox-dropdown-menu{width:auto!important}.yith-wcwl-with-pretty-photo{overflow:hidden}.woocommerce .wishlist-fragment .blockUI.blockOverlay::before,.woocommerce .yith-wcwl-popup-form .blockUI.blockOverlay::before{display:none}.yith-wcwl-popup{display:none}.yith-wcwl-popup-content h3{text-align:center;font-size:1.5em}.yith-wcwl-popup-content .heading-icon,.yith-wcwl-popup-feedback .heading-icon{text-align:center;display:block;font-size:70px;color:#333;margin-bottom:15px}.yith-wcwl-popup-content .popup-description{text-align:center;font-weight:600;margin-bottom:15px}.yith-wcwl-popup-content .popup-description a.show-tab.active{cursor:inherit;color:inherit;pointer-events:none}.yith-wcwl-popup-feedback p.feedback{margin-top:1.5em;text-align:center;font-size:1.1rem;font-weight:600}.yith-wcwl-popup-content label{display:block}.yith-wcwl-popup-content input[type=text],.yith-wcwl-popup-content select{padding:10px 7px}.yith-wcwl-popup-content .create{display:none}.yith-wcwl-popup-content .yith-wcwl-second-row{display:none}.yith-wcwl-popup-footer{margin-top:15px}.yith-wcwl-popup-footer .button.wishlist-submit{display:block;width:100%;text-align:center}.pp_pic_holder.pp_woocommerce.feedback{max-width:450px!important}.pp_pic_holder.pp_woocommerce.feedback .pp_content{width:auto!important}.yith-wcwl-popup-feedback{margin-top:2em;margin-bottom:2em}.yith-wcwl-add-button.with-dropdown{position:relative;padding:15px 0}.yes-js .yith-wcwl-add-button ul.yith-wcwl-dropdown{display:none;list-style:none;margin-bottom:0;padding:5px 25px;border:1px solid #cdcdcd;background:#fff;position:absolute;z-index:15;top:calc(100% - 5px);min-width:200px}.yith-wcwl-add-button.show-dropdown ul.yith-wcwl-dropdown{display:block}.yith-wcwl-add-button ul.yith-wcwl-dropdown li{padding:15px;padding-left:0;text-transform:uppercase;font-size:.8em}.yith-wcwl-add-button ul.yith-wcwl-dropdown li a{font-size:1em!important;color:inherit;box-shadow:none}.yith-wcwl-add-button ul.yith-wcwl-dropdown li a:hover{color:initial}.yith-wcwl-add-button ul.yith-wcwl-dropdown li:before{font-family:FontAwesome;content:'\f067';margin-right:15px}.yith-wcwl-add-button ul.yith-wcwl-dropdown li:not(:last-child){border-bottom:1px solid #cdcdcd}.yith-wcwl-add-to-wishlist .separator+[data-title]{display:inline-block}.yith-wcwl-add-to-wishlist .with-tooltip{position:relative}.yith-wcwl-tooltip{z-index:10;padding:5px 10px;border-radius:5px;text-align:center;top:calc(100% + 5px);pointer-events:none;cursor:initial;font-size:.6875rem;line-height:normal;display:none}.with-dropdown .yith-wcwl-tooltip{top:auto;bottom:calc(100% + 10px)}.with-tooltip .yith-wcwl-tooltip{position:absolute}.with-tooltip .yith-wcwl-tooltip:before{content:'';display:block;position:absolute;top:-5px;left:calc(50% - 2px);width:0;height:0;background:0 0!important;border-left:5px solid transparent!important;border-right:5px solid transparent!important;border-bottom:5px solid}.with-dropdown .with-tooltip .yith-wcwl-tooltip:before{bottom:-5px;top:auto;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;border-bottom:none}#yith-wcwl-popup-message{font-weight:700;line-height:50px;text-align:center;background:#fff;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3);position:fixed;top:50%;left:50%;padding:7px 40px;z-index:10000}.wishlist-title{display:inline-block}.wishlist-title h2{display:inline-block;padding:5px}.wishlist-title.wishlist-title-with-form h2:hover{background:#efefef}.wishlist-title a.show-title-form{cursor:pointer;visibility:hidden}.wishlist-title:hover a.show-title-form{visibility:visible}.yes-js #yith-wcwl-form .hidden-title-form{display:none;margin:25px 0 39px}table.wishlist_table{font-size:80%}table.wishlist_table tr{position:relative}table.wishlist_table thead th{border-top:1px solid;padding:16px 12px}table.wishlist_table tbody td{padding:16px 12px}table.wishlist_table tbody td,table.wishlist_table thead th{border-color:#e7e7e7}.wishlist_table tr td,.wishlist_table tr th.product-checkbox,.wishlist_table tr th.wishlist-delete{text-align:center}.wishlist_table tr th.product-checkbox{vertical-align:middle;width:40px}.wishlist_table tr th.product-remove{vertical-align:middle;width:40px}.wishlist_table tr th.product-thumbnail{width:80px}.wishlist_table tfoot td,.wishlist_table tr td.product-name,.wishlist_table tr td.product-thumbnail,.wishlist_table tr td.wishlist-name,.wishlist_table tr td.wishlist-privacy{text-align:left}.wishlist_table tr td.product-remove{padding:16px 0}.wishlist_table tr td.product-thumbnail a{display:block;border:none;max-width:80px}.wishlist_table tr td.product-thumbnail a img{width:100%}.wishlist_table tr td.product-arrange{cursor:grab}.wishlist_table tr td.product-arrange:active{cursor:grabbing}.wishlist_table .product-stock-status span.wishlist-in-stock{color:#297e29}.wishlist_table .product-stock-status span.wishlist-out-of-stock{color:red}.wishlist_table .product-add-to-cart span.dateadded{display:block}.wishlist_table .product-add-to-cart a{display:table!important;margin:0 auto 5px!important;text-align:center}.wishlist_table .product-add-to-cart a.button{padding:6px 25px!important}.wishlist_table .product-add-to-cart a>img{display:inline;max-width:2em}.wishlist_table .price-variation{display:block}.wishlist_table .price-variation.decrease .variation-rate{color:red}.wishlist_table .price-variation .old-price{display:block}.wishlist_table a.button{white-space:normal;margin-bottom:5px!important}.wishlist_table.modern_grid{list-style:none;margin:0 -7px 35px;font-size:0}.wishlist_table.modern_grid li{display:inline-block;vertical-align:top;width:33.33%;padding:0 7px;margin-bottom:15px}.wishlist_table.images_grid li.wishlist-empty,.wishlist_table.modern_grid li.wishlist-empty{width:100%;font-size:1rem}.wishlist_table.images_grid li.show{z-index:10}.wishlist_table.modern_grid li .item-wrapper{display:table;margin:0 -7px}.wishlist_table.modern_grid li .item-details,.wishlist_table.modern_grid li .product-thumbnail{display:table-cell;vertical-align:top;box-sizing:border-box;width:50%;padding:0 7px;font-size:1rem}.wishlist_table.images_grid li .product-thumbnail,.wishlist_table.modern_grid li .product-thumbnail{position:relative}.wishlist_table.images_grid li .product-thumbnail .product-checkbox,.wishlist_table.modern_grid li .product-thumbnail .product-checkbox{position:absolute;top:7px;left:15px;z-index:2}.wishlist_table.modern_grid li .product-thumbnail>a{display:block}.wishlist_table.modern_grid li .product-thumbnail>a img{display:block}.wishlist_table.images_grid li.show .product-thumbnail>a img,.wishlist_table.images_grid li:hover .product-thumbnail>a img{filter:brightness(1.1)}.wishlist_table.modern_grid.wishlist_view li .item-details{position:relative}.wishlist_table.modern_grid.wishlist_view li .item-details:before{content:'';display:block;top:0;bottom:0;left:7px;background:#fff;position:absolute;right:7px;z-index:0;border:1px solid #cdcdcd}.wishlist_table.images_grid li .item-details{display:none;position:absolute;z-index:2;bottom:15px;left:calc(50% - 150px);width:300px;background:#fff;padding:10px 20px;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3)}.wishlist_table.images_grid li.show .item-details{display:block}.wishlist_table.modern_grid li .item-details .item-details-wrapper{padding:15px 20px;line-height:normal;position:relative}.wishlist_table.images_grid li .item-details a.close{position:absolute;top:10px;right:20px}.wishlist_table.images_grid li .item-details h3,.wishlist_table.mobile li .item-details h3,.wishlist_table.modern_grid li .item-details h3{margin-bottom:7px}.wishlist_table.images_grid li .item-details table.item-details-table,.wishlist_table.mobile li .item-details table.item-details-table,.wishlist_table.mobile li table.additional-info,.wishlist_table.modern_grid li .item-details table.item-details-table{border:none;margin-bottom:7px}.wishlist_table.images_grid li .item-details table.item-details-table td,.wishlist_table.mobile li .item-details table.item-details-table td,.wishlist_table.mobile li table.additional-info td,.wishlist_table.modern_grid li .item-details table.item-details-table td{border:none;font-size:.7em;padding:3px;vertical-align:top}.wishlist_table.images_grid li .item-details table.item-details-table td.label,.wishlist_table.mobile li .item-details table.item-details-table td.label,.wishlist_table.mobile li table.additional-info td.label,.wishlist_table.modern_grid li .item-details table.item-details-table td.label{text-align:left;font-weight:700;width:40%}.wishlist_table.images_grid li .item-details table.item-details-table td.value,.wishlist_table.mobile li .item-details table.item-details-table td.value,.wishlist_table.mobile li table.additional-info td.value,.wishlist_table.modern_grid li .item-details table.item-details-table td.value{text-align:right}.wishlist_table.modern_grid li .item-details table.item-details-table td.value a.selectBox{margin-right:0}.wishlist_table.images_grid li .item-details table.item-details-table td.value input,.wishlist_table.mobile li table.additional-info td.value input,.wishlist_table.modern_grid li .item-details table.item-details-table td.value input{width:auto}.wishlist_table.images_grid li .item-details .product-add-to-cart,.wishlist_table.modern_grid li .item-details .product-add-to-cart{text-align:center;margin-bottom:7px}.wishlist_table.images_grid li .item-details .move-to-another-wishlist,.wishlist_table.modern_grid li .item-details .move-to-another-wishlist{text-align:center;margin-bottom:7px}.wishlist_table.images_grid li .item-details .product-remove,.wishlist_table.modern_grid li .item-details .product-remove{text-align:right}.wishlist_table.images_grid li .item-details .product-remove a,.wishlist_table.modern_grid li .item-details .product-remove a{border:none;border-radius:0;display:inline-block}.wishlist_table.mobile{list-style:none;margin-left:0}.wishlist_table.mobile li{margin-bottom:7px}.wishlist_table.mobile li .product-checkbox{display:inline-block;width:20px;vertical-align:top}.wishlist_table.mobile li .item-wrapper{display:inline-block;width:calc(100% - 25px);vertical-align:top;margin-bottom:7px}.wishlist_table.wishlist_manage_table.mobile li .item-wrapper{width:100%}.wishlist_table.mobile li .item-wrapper .product-thumbnail{display:inline-block;max-width:60px;margin-right:10px}.wishlist_table.mobile li .item-wrapper .item-details{display:inline-block;width:calc(100% - 80px);vertical-align:top}.wishlist_table.mobile.with-checkbox li .additional-info-wrapper{padding-left:20px}.wishlist_table.mobile li .additional-info-wrapper .move-to-another-wishlist,.wishlist_table.mobile li .additional-info-wrapper .product-add-to-cart{text-align:center;margin-bottom:7px}.wishlist_table.mobile li .additional-info-wrapper .product-remove{text-align:right}a.add_to_wishlist{cursor:pointer}.yith-wcwl-add-to-wishlist .feedback .yith-wcwl-icon{margin-right:5px}.yith-wcwl-add-to-wishlist a.add_to_wishlist>img,.yith-wcwl-add-to-wishlist a.delete_item>img,.yith-wcwl-add-to-wishlist a.move_to_another_wishlist>img{max-width:32px;display:inline-block;margin-right:10px}a.add_to_wishlist+a.view-wishlist,a.delete_item+a.view-wishlist{margin-left:15px}.summary .single_add_to_wishlist.button,div.product .woocommerce-price-and-add .single_add_to_wishlist.button{margin:0}.wishlist_table .add_to_cart.button{padding:7px 12px;line-height:normal}.yith-wcwl-add-to-wishlist{margin-top:10px}.hidden-title-form a.hide-title-form i,.hidden-title-form button i,.wishlist-title a.show-title-form i,.wishlist_manage_table tfoot a.create-new-wishlist i,.wishlist_manage_table tfoot button.submit-wishlist-changes i,.wishlist_table .add_to_cart.button i,.wishlist_table .ask-an-estimate-button i,.yith-wcwl-add-button>a i,.yith-wcwl-wishlist-new button i,.yith-wcwl-wishlist-search-form button.wishlist-search-button i{margin-right:10px}.hidden-title-form a.hide-title-form,.wishlist-title a.show-title-form,.wishlist_manage_table a.create-new-wishlist,.wishlist_manage_table button.submit-wishlist-changes,.wishlist_table .add_to_cart.button,.wishlist_table a.ask-an-estimate-button,.woocommerce .yith-wcwl-wishlist-new button,.yith-wcwl-add-button a.add_to_wishlist,.yith-wcwl-popup-button a.add_to_wishlist,.yith-wcwl-wishlist-search-form button.wishlist-search-button{margin:0;box-shadow:none;text-shadow:none}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist{position:absolute;z-index:10;margin:0;top:10px;left:10px}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .with-dropdown{padding:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .add_to_wishlist,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .disabled_item,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .open-pretty-photo{font-size:0;background:0 0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .delete_item,.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .move_to_another_wishlist{font-size:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .feedback{display:none}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist .feedback+a{font-size:0;background:0 0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist i{font-size:1.6rem;margin:0}.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist img{margin:0}.woocommerce .wishlist-title{margin-bottom:30px}.woocommerce .wishlist-title h2{vertical-align:middle;margin-bottom:0}.woocommerce .hidden-title-form button{padding:7px 24px;vertical-align:middle;border:none;position:relative}.woocommerce .hidden-title-form button:active{top:1px}.woocommerce .hidden-title-form a.hide-title-form{vertical-align:middle;line-height:normal}.woocommerce .back-to-all-wishlists{margin-bottom:20px}.woocommerce #content table.wishlist_table.cart a.remove{color:#c3c3c3;margin:0 auto}.woocommerce #content table.wishlist_table.cart a.remove:hover{background-color:#c3c3c3;color:#fff}.yith-wcwl-share{margin-bottom:35px}.yith-wcwl-share h4.yith-wcwl-share-title{margin:10px 0}.yith-wcwl-share ul{margin:5px 0;padding:0}.entry-content .yith-wcwl-share ul li,.yith-wcwl-share ul li{display:inline-block;margin-left:0;margin-right:0}.yith-wcwl-share li a{color:#fff;text-align:center;text-decoration:none;line-height:1;padding:5px;display:block;border:none;min-width:26px;min-height:26px}.yith-wcwl-share li a:hover{color:#fff}.yith-wcwl-share li a>img{max-width:1em}.copy-trigger{cursor:pointer}.woocommerce .ask-an-estimate-button>img{max-width:1em;display:inline;margin-right:5px}#ask_an_estimate_popup{display:none}.wishlist-ask-an-estimate-popup .ask-an-estimate-button-popup{width:100%}.wishlist-ask-an-estimate-popup .woocommerce-error{margin-bottom:0}.wishlist-ask-an-estimate-popup #additional_notes{min-height:150px}.ask-an-estimate-confirmation{padding:0 30px;text-align:center}.yith_wcwl_wishlist_footer>div{margin-bottom:15px}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_bulk_action{float:left}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_bulk_action #bulk_actions{min-width:250px}.yith_wcwl_wishlist_footer .yith_wcwl_wishlist_update{float:right}.yith_wcwl_wishlist_footer .yith-wcwl-share{float:left;clear:both}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action{float:right}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action>*{vertical-align:middle}.yith_wcwl_wishlist_update+.yith_wcwl_footer_additional_action{clear:both}.wishlist-page-links{clear:both}#move_to_another_wishlist{display:none}.yith-wcwl-wishlist-new{padding:20px 0}.yith-wcwl-popup-content .yith-wcwl-wishlist-new{padding:0}.yith-wcwl-wishlist-new .wishlist-name{display:inline-block}.yith-wcwl-wishlist-new .wishlist-privacy-radio label{display:block}.yith-wcwl-popup-content .create-wishlist-button{margin-top:15px;width:100%}#create_new_wishlist{display:none}.wishlist_manage_table select{vertical-align:middle;margin-right:10px}.wishlist_manage_table td.wishlist-name .wishlist-title{margin-bottom:0}.wishlist_manage_table td.wishlist-name .wishlist-title .show-title-form{display:inline-block;padding:0;border:none;background:0 0;top:0;margin:0}.wishlist_manage_table td.wishlist-name a.show-title-form i{padding:5px;margin:0}.wishlist_manage_table td.wishlist-name:hover a.show-title-form{visibility:visible}.wishlist_manage_table td.wishlist-name .hidden-title-form{margin:0!important}.wishlist_manage_table td.wishlist-name .hidden-title-form input[type=text]{width:100%;min-width:0}.wishlist_manage_table td.wishlist-name .hidden-title-form{position:relative}.wishlist_manage_table td.wishlist-name .hidden-title-form .edit-title-buttons{position:absolute;right:0;top:0}.wishlist_manage_table td.wishlist-name .hidden-title-form a{float:right;cursor:pointer;margin-left:5px}.wishlist_manage_table td.wishlist-name .hidden-title-form a i{padding:5px;margin:0}table.wishlist_manage_table tfoot td{text-align:right;padding:24px 12px}.wishlist_manage_table tfoot button.submit-wishlist-changes{padding:7px 24px;vertical-align:middle;border:1px solid;border-radius:3px;position:relative;line-height:normal}.wishlist_manage_table tfoot button.submit-wishlist-changes:active{top:1px}.wishlist_manage_table tfoot a.create-new-wishlist{vertical-align:middle;line-height:normal;padding:7px 24px}.wishlist_manage_table.modern_grid li .item-wrapper{display:block;margin:0;padding:40px 50px;background:#fff;border:1px solid #cdcdcd}.wishlist_manage_table.modern_grid li .item-details,.wishlist_manage_table.modern_grid li .product-thumbnail{display:block;width:100%;padding:0}.wishlist_manage_table.modern_grid li .item-details .hidden-title-form{position:relative}.wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons{position:absolute;right:0;top:0}.wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons a{float:right;line-height:1;cursor:pointer;margin-left:5px}.wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons a i{padding:5px;margin:0}.wishlist_manage_table.modern_grid li .product-thumbnail img:first-child{width:100%;margin-bottom:15px}.wishlist_manage_table.modern_grid li .product-thumbnail img{width:calc(50% - 8px)}.wishlist_manage_table.modern_grid li .product-thumbnail img:nth-child(3){margin-left:15px}.wishlist_manage_table.modern_grid li .wishlist-title-with-form{display:block}.wishlist_manage_table.modern_grid li .wishlist-title-with-form h3{display:inline-block}.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form,.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form:hover{visibility:visible;float:right;margin:0;background:0 0;color:inherit}.wishlist_manage_table.modern_grid li .wishlist-title-with-form .show-title-form i{margin:0}.wishlist_manage_table.modern_grid li .hidden-title-form{margin-top:0!important}.wishlist_manage_table.modern_grid li .hidden-title-form input[type=text]{width:100%;min-width:0}.wishlist_manage_table.mobile li{margin-bottom:30px}.wishlist_manage_table.mobile li .item-wrapper .item-details{width:100%}.wishlist_manage_table.mobile li .item-details .hidden-title-form{position:relative}.wishlist_manage_table.mobile li .item-details .hidden-title-form input[type=text]{width:100%}.wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons{position:absolute;right:0;top:0}.wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons a{float:right;line-height:1;cursor:pointer;margin-left:5px}.wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons a i{padding:5px;margin:0}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title{display:block;border-bottom:1px solid #cdcdcd;position:relative}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form a.show-title-form{position:absolute;right:0;top:0;visibility:visible}.wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form a.show-title-form i{margin-right:0}.wishlist_manage_table.mobile li .item-details table.item-details-table td.value a.selectBox{margin-right:0}.wishlist_manage_table.mobile li .item-details table.item-details-table td.value a.wishlist-download{float:left}.yith-wcwl-wishlist-search-form{text-align:center;padding:20px 0}.yith-wcwl-wishlist-search-form #wishlist_search{display:inline-block;max-width:300px;vertical-align:middle}.yith-wcwl-wishlist-search-form button.wishlist-search-button{display:inline-block;padding:7px 24px;vertical-align:middle;border:1px solid;border-radius:3px;position:relative;line-height:normal}.yith-wcwl-wishlist-search-form button.wishlist-search-button i{margin:0}.yith-wcwl-wishlist-search-form button.wishlist-search-button:active{top:1px}.yith-wcwl-search-results .wishlist-owner{text-align:left}.yith-wcwl-search-results .wishlist-owner .thumb{display:inline-block;margin-right:15px}.yith-wcwl-add-to-wishlist .ajax-loading{box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important;display:inline!important;margin-left:5px;vertical-align:middle;visibility:hidden;width:16px!important;height:16px!important}.widget_yith-wcwl-lists ul.dropdown li{padding:0}.widget_yith-wcwl-lists ul.dropdown ul.lists>li a,.widget_yith-wcwl-lists ul.dropdown>li a{display:block;padding:5px 15px}.widget_yith-wcwl-lists ul.dropdown ul.lists>li a{padding:5px 25px}.widget_yith-wcwl-lists ul.dropdown>li.lists-section{border-bottom:1px solid #e7e7e7}.widget_yith-wcwl-lists ul.dropdown ul.lists{margin:0}.widget_yith-wcwl-items .mini{position:relative}.widget_yith-wcwl-items .heading{text-align:center;cursor:pointer}.widget_yith-wcwl-items .mini .heading{display:inline-block}.widget_yith-wcwl-items .heading a{color:inherit}.widget_yith-wcwl-items .extended .heading .items-counter{position:relative}.widget_yith-wcwl-items .extended .heading .items-counter i{font-size:70px;position:relative;margin-bottom:10px}.widget_yith-wcwl-items .mini .heading .items-counter i{font-size:30px}.widget_yith-wcwl-items .extended .heading .items-counter .items-count{display:block;position:absolute;left:0;right:0;text-align:center;top:calc(50% - 20px);font-size:1rem}.widget_yith-wcwl-items .mini .heading .items-counter .items-count{font-size:1rem}.widget_yith-wcwl-items .extended .heading h3:after{content:'';display:block;max-width:80px;border-bottom:1px solid #cdcdcd;margin:10px auto}.widget_yith-wcwl-items .mini .list{position:absolute;z-index:1;left:0;background:#fff;padding:25px 40px;display:none;-webkit-box-shadow:0 0 15px rgba(0,0,0,.3);-moz-box-shadow:0 0 15px rgba(0,0,0,.3);box-shadow:0 0 15px rgba(0,0,0,.3)}.widget_yith-wcwl-items .mini:hover .list{display:block}.widget_yith-wcwl-items ul.product_list_widget{margin-bottom:40px!important}.widget_yith-wcwl-items p.empty-wishlist{margin-bottom:0!important}.widget_yith-wcwl-items .mini ul.product_list_widget{margin-left:-20px}.widget_yith-wcwl-items ul.product_list_widget li{display:table}.widget_yith-wcwl-items ul.product_list_widget li:not(:last-child){margin-bottom:10px}.widget_yith-wcwl-items ul.product_list_widget li .image-thumb,.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info,.widget_yith-wcwl-items ul.product_list_widget li .remove_from_all_wishlists{display:table-cell;vertical-align:middle}.widget_yith-wcwl-items ul.product_list_widget li .remove_from_all_wishlists{font-size:1.2rem}.widget_yith-wcwl-items ul.product_list_widget li .image-thumb img{margin-left:10px;max-width:40px}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info{display:inline-block;vertical-align:middle;margin-left:10px}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info a{display:inline-block}.widget_yith-wcwl-items ul.product_list_widget li .mini-cart-item-info>*{display:block}.widget_yith-wcwl-items .show-wishlist,.widget_yith-wcwl-items a.add_all_to_cart{display:block!important}.widget_yith-wcwl-items .show-wishlist{margin-bottom:10px}.widget_yith-wcwl-items a.add_all_to_cart{text-align:center}@media(max-width:768px){.yith_wcwl_wishlist_bulk_action select{width:100%;margin-bottom:15px}.yith_wcwl_wishlist_bulk_action input{float:right}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action{float:none}.yith_wcwl_wishlist_footer .yith_wcwl_footer_additional_action .ask-an-estimate-button{width:100%;text-align:center}}
assets/css/unminified/style.css CHANGED
@@ -377,7 +377,6 @@ table.wishlist_table tbody td{
377
.wishlist_table tr th.wishlist-delete,
378
.wishlist_table tr th.product-checkbox {
379
text-align: center;
380
- background: #fff;
381
}
382
383
.wishlist_table tr th.product-checkbox {
@@ -1018,6 +1017,24 @@ div.product .woocommerce-price-and-add .single_add_to_wishlist.button {
1018
margin-bottom: 0;
1019
}
1020
1021
.wishlist_manage_table td.wishlist-name .hidden-title-form{
1022
margin: 0!important;
1023
}
@@ -1027,6 +1044,27 @@ div.product .woocommerce-price-and-add .single_add_to_wishlist.button {
1027
min-width: 0;
1028
}
1029
1030
table.wishlist_manage_table tfoot td{
1031
text-align: right;
1032
padding: 24px 12px;
@@ -1067,8 +1105,26 @@ table.wishlist_manage_table tfoot td{
1067
padding: 0;
1068
}
1069
1070
- .wishlist_manage_table.modern_grid li .item-details table.item-details-table td{
1071
- /*font-size: 1em;*/
1072
}
1073
1074
.wishlist_manage_table.modern_grid li .product-thumbnail img:first-child{
@@ -1123,7 +1179,33 @@ table.wishlist_manage_table tfoot td{
1123
width: 100%;
1124
}
1125
1126
- .wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title-with-form{
1127
display: block;
1128
border-bottom: 1px solid #cdcdcd;
1129
position: relative;
377
.wishlist_table tr th.wishlist-delete,
378
.wishlist_table tr th.product-checkbox {
379
text-align: center;
380
}
381
382
.wishlist_table tr th.product-checkbox {
1017
margin-bottom: 0;
1018
}
1019
1020
+ .wishlist_manage_table td.wishlist-name .wishlist-title .show-title-form{
1021
+ display: inline-block;
1022
+ padding: 0;
1023
+ border: none;
1024
+ background: none;
1025
+ top: 0;
1026
+ margin: 0;
1027
+ }
1028
+
1029
+ .wishlist_manage_table td.wishlist-name a.show-title-form i{
1030
+ padding: 5px;
1031
+ margin: 0;
1032
+ }
1033
+
1034
+ .wishlist_manage_table td.wishlist-name:hover a.show-title-form{
1035
+ visibility: visible;
1036
+ }
1037
+
1038
.wishlist_manage_table td.wishlist-name .hidden-title-form{
1039
margin: 0!important;
1040
}
1044
min-width: 0;
1045
}
1046
1047
+ .wishlist_manage_table td.wishlist-name .hidden-title-form{
1048
+ position: relative;
1049
+ }
1050
+
1051
+ .wishlist_manage_table td.wishlist-name .hidden-title-form .edit-title-buttons{
1052
+ position: absolute;
1053
+ right: 0;
1054
+ top: 0;
1055
+ }
1056
+
1057
+ .wishlist_manage_table td.wishlist-name .hidden-title-form a{
1058
+ float: right;
1059
+ cursor: pointer;
1060
+ margin-left: 5px;
1061
+ }
1062
+
1063
+ .wishlist_manage_table td.wishlist-name .hidden-title-form a i{
1064
+ padding: 5px;
1065
+ margin: 0;
1066
+ }
1067
+
1068
table.wishlist_manage_table tfoot td{
1069
text-align: right;
1070
padding: 24px 12px;
1105
padding: 0;
1106
}
1107
1108
+ .wishlist_manage_table.modern_grid li .item-details .hidden-title-form{
1109
+ position: relative;
1110
+ }
1111
+
1112
+ .wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons{
1113
+ position: absolute;
1114
+ right: 0;
1115
+ top: 0;
1116
+ }
1117
+
1118
+ .wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons a{
1119
+ float: right;
1120
+ line-height: 1;
1121
+ cursor: pointer;
1122
+ margin-left: 5px;
1123
+ }
1124
+
1125
+ .wishlist_manage_table.modern_grid li .item-details .hidden-title-form .edit-title-buttons a i{
1126
+ padding: 5px;
1127
+ margin: 0;
1128
}
1129
1130
.wishlist_manage_table.modern_grid li .product-thumbnail img:first-child{
1179
width: 100%;
1180
}
1181
1182
+ .wishlist_manage_table.mobile li .item-details .hidden-title-form{
1183
+ position: relative;
1184
+ }
1185
+
1186
+ .wishlist_manage_table.mobile li .item-details .hidden-title-form input[type="text"]{
1187
+ width: 100%;
1188
+ }
1189
+
1190
+ .wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons{
1191
+ position: absolute;
1192
+ right: 0;
1193
+ top: 0;
1194
+ }
1195
+
1196
+ .wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons a{
1197
+ float: right;
1198
+ line-height: 1;
1199
+ cursor: pointer;
1200
+ margin-left: 5px;
1201
+ }
1202
+
1203
+ .wishlist_manage_table.mobile li .item-details .hidden-title-form .edit-title-buttons a i{
1204
+ padding: 5px;
1205
+ margin: 0;
1206
+ }
1207
+
1208
+ .wishlist_manage_table.mobile li .item-wrapper .item-details .wishlist-title{
1209
display: block;
1210
border-bottom: 1px solid #cdcdcd;
1211
position: relative;
assets/js/jquery.yith-wcwl.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(r){function i(){void 0!==r.fn.selectBox&&r("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==r.prettyPhoto){var t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),r(".wishlist-select").change(),r(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};r('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(t),r('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=r(this),i=r("#move_to_another_wishlist").find("form"),e=i.find(".row-id"),a=t.closest("[data-row-id]").data("row-id");e.length&&e.remove(),i.append('<input type="hidden" name="row_id" class="row-id" value="'+a+'"/>')}).prettyPhoto(t),new MutationObserver(function(t,i){for(var e in t){var a=t[e];"childList"===a.type&&(void 0!==a.addedNodes&&a.addedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").addClass("yith-wcwl-with-pretty-photo")}),void 0!==a.removedNodes&&a.removedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").removeClass("yith-wcwl-with-pretty-photo")}))}}).observe(document.body,{childList:!0})}}function a(){r(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=r(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function o(){r(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t,i=r(this),e=i.data("icon");t=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?r("<img/>",{src:e}):r("<i/>",{class:"fa "+e}),i.prepend(t).addClass("icon-added")})}function h(){i(),e(),a(),o(),d(),n(),_(),l(),c(),r(document).trigger("yith_wcwl_init_after_ajax")}function n(){yith_wcwl_l10n.enable_tooltip&&r(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=r(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t,i=r(this),e=null,a=i.outerWidth(),o=0;e=r("<span>",{class:"yith-wcwl-tooltip",text:i.data("title")}),i.append(e),t=e.outerWidth()+6,e.outerWidth(t),o=(a-t)/2,e.css({left:o.toFixed(0)+"px"}).fadeIn(200),i.addClass("with-tooltip")}).on("mouseleave",function(){var t=r(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function d(){r(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=r(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=r(this).closest(".with-dropdown"),i=t.find(".yith-wcwl-dropdown");i.length&&i.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&r(".wishlist_table").each(function(){var e=r(this),a=!1;e.sortable({items:"[data-row-id]",helper:function(t,i){return i.children().each(function(){r(this).width(r(this).width())}),i},update:function(){var t=e.find("[data-row-id]"),i=[];t.length&&(a&&a.abort(),t.each(function(){var t=r(this);i.push(t.data("row-id"))}),a=r.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,positions:i,wishlist_token:e.data("token"),page:e.data("page"),per_page:e.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function c(){r(".copy-trigger").on("click",function(){var t=r(".copy-target");if(0<t.length)if(t.is("input"))s()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy");else{var i=r("<input/>",{val:t.text(),type:"text"});b("body").append(i),s()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy"),i.remove()}})}function _(){r(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var i=r(this).closest("[data-row-id]"),e=i.siblings("[data-row-id]"),a=i.find(".item-details");t.preventDefault(),a.length&&(e.removeClass("show"),i.toggleClass("show"))}).on("click","[data-row-id] a.close",function(t){var i=r(this).closest("[data-row-id]"),e=i.find(".item-details");t.preventDefault(),e.length&&i.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var i=r(this);return t.stopPropagation(),f(i),!1}).addClass("enhanced"),r(document).on("click",function(t){r(t.target).closest("[data-row-id]").length||r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function w(i,t,e){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&r.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(t){e(t),h(),r("body").trigger("moved_to_another_wishlist",[r(this),i.item_id])}})}function f(i){var t=i.parents(".cart.wishlist_table"),e=i.parents("[data-row-id]"),a=e.data("row-id"),o=t.data("id"),n=t.data("token"),s={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,remove_from_wishlist:a,wishlist_id:o,wishlist_token:n,fragments:C(a)};r.ajax({beforeSend:function(){y(t)},complete:function(){k(t)},data:s,method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h(),r("body").trigger("removed_from_wishlist",[i,e])},url:yith_wcwl_l10n.ajax_url})}function p(t){var i=r(this),e=i.closest(".wishlist_table"),a=null;t.preventDefault(),(a=e.length?i.closest("[data-wishlist-id]").find(".wishlist-title"):i.parents(".wishlist-title")).next().show(),a.hide()}function u(t){var i=r(this);t.preventDefault(),i.parents(".hidden-title-form").hide(),i.parents(".hidden-title-form").prev().show()}function m(t){if(void 0!==r.prettyPhoto&&void 0!==r.prettyPhoto.close)if(void 0!==t){var i=r(".pp_content_container"),e=i.find(".pp_content"),a=i.find(".yith-wcwl-popup-form"),o=a.closest(".pp_pic_holder");if(a.length){var n=r("<div/>",{class:"yith-wcwl-popup-feedback"});n.append(r("<i/>",{class:"fa fa-check heading-icon"})),n.append(r("<p/>",{class:"feedback",html:t})),n.css("display","none"),e.css("height","auto"),a.after(n),a.fadeOut(200,function(){n.fadeIn()}),o.addClass("feedback"),o.css("left",r(window).innerWidth()/2-o.outerWidth()/2+"px"),setTimeout(m,yith_wcwl_l10n.popup_timeout)}}else try{r.prettyPhoto.close()}catch(t){}}function v(t){var i=r("#yith-wcwl-popup-message"),e=r("#yith-wcwl-message");yith_wcwl_l10n.enable_notices&&(e.html(t),i.css("margin-left","-"+r(i).width()+"px").fadeIn(),window.setTimeout(function(){i.fadeOut()},yith_wcwl_l10n.popup_timeout))}function g(n){var t=r("select.wishlist-select"),i=r("ul.yith-wcwl-dropdown");t.each(function(){var e=r(this),t=e.find("option"),i=t.filter('[value="new"]');t.not(i).remove(),r.each(n,function(t,i){r("<option>",{value:i.id,html:i.wishlist_name}).appendTo(e)}),e.append(i)}),i.each(function(){var e=r(this),t=e.find("li"),i=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),a=i.attr("data-product-id"),o=i.attr("data-product-type");t.remove(),r.each(n,function(t,i){r("<li>").append(r("<a>",{rel:"nofollow",html:i.wishlist_name,class:"add_to_wishlist",href:i.add_to_this_wishlist_url,"data-product-id":a,"data-product-type":o,"data-wishlist-id":i.id})).appendTo(e)})})}function y(t){void 0!==r.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function k(t){void 0!==r.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function x(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function C(t){var e={},i=r(".wishlist-fragment");return t&&("object"==typeof t?((t=r.extend({s:"",firstLoad:!1},t)).s&&(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(i=i.filter(".on-first-load"))):"string"!=typeof t&&"number"!=typeof t||(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t+'"]')))),i.each(function(){var t=r(this),i=t.attr("class");e[i]=t.data("fragment-options")}),e}function j(t){r.each(t,function(t,i){var e="."+t.split(" ").filter(function(t){return t.length&&"exists"!==t}).join("."),a=r(e),o=r(i).filter(e);o.length||(o=r(i).find(e)),a.length&&o.length&&a.replaceWith(o)})}function s(){return navigator.userAgent.match(/ipad|iphone/i)}r(document).on("yith_wcwl_init",function(){var t=r(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var a=r(this),i=a.attr("data-product-id"),o=r(".add-to-wishlist-"+i),e={add_to_wishlist:i,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),action:yith_wcwl_l10n.actions.add_to_wishlist_action,fragments:C(i)};if(t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var n=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),s=n.find(".wishlist-select"),d=n.find(".wishlist-name"),l=n.find(".wishlist-visibility").filter(":checked");if(e.wishlist_id=s.is(":visible")?s.val():"new",e.wishlist_name=d.val(),e.wishlist_visibility=l.val(),"new"===e.wishlist_id&&!e.wishlist_name)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid")}if(x())return r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=t.result,e=t.message;yith_wcwl_l10n.multi_wishlist?(m(e),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(e),"true"!==i&&"exists"!==i||(void 0!==t.fragments&&j(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||o.find(".yith-wcwl-add-button").remove(),o.addClass("exists")),h(),r("body").trigger("added_to_wishlist",[a,o])}}),!1;alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var i=r(this);return t.preventDefault(),f(i),!1}),t.on("adding_to_cart","body",function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=yith_wcwl_l10n.redirect_to_cart))}),t.on("added_to_cart","body",function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=s);var o=a.closest("[data-row-id]"),n=o.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),o.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&n.is_user_owner&&o.remove()}}),t.on("added_to_cart","body",function(){var t=r(".woocommerce-message");0===t.length?r("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){r(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",h),t.on("click",".show-title-form",p),t.on("click",".wishlist-title-with-form h2",p),t.on("click",".remove_from_all_wishlists",function(t){var i=r(this),e=i.attr("data-product-id"),a=i.data("wishlist-id"),o=i.closest(".content"),n={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,prod_id:e,wishlist_id:a,fragments:C(e)};t.preventDefault(),r.ajax({beforeSend:function(){y(o)},complete:function(){k(o)},data:n,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",u),t.on("change",".change-wishlist",function(){var t=r(this),i=t.parents(".cart.wishlist_table"),e=i.data("token"),a=t.parents("[data-row-id]").data("row-id");w({wishlist_token:e,destination_wishlist_token:t.val(),item_id:a,fragments:C()},function(){y(i)},function(t){void 0!==t.fragments&&j(t.fragments),k(i)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var e=r(this),t=e.attr("data-product-id"),i=e.data("origin-wishlist-id"),a=e.closest("form"),o=a.find(".wishlist-select").val(),n=a.find(".wishlist-name"),s=n.val(),d=a.find(".wishlist-visibility").filter(":checked").val();if("new"===o&&!s)return n.closest("p").addClass("woocommerce-invalid"),!1;n.closest("p").removeClass("woocommerce-invalid"),w({wishlist_token:i,destination_wishlist_token:o,item_id:t,wishlist_name:s,wishlist_visibility:d,fragments:C(t)},function(){y(e)},function(t){var i=t.message;yith_wcwl_l10n.multi_wishlist?(m(i),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(i),void 0!==t.fragments&&j(t.fragments),h(),k(e)})}),t.on("click",".delete_item",function(){var a=r(this),t=a.attr("data-product-id"),i=a.data("item-id"),o=r(".add-to-wishlist-"+t);return r.ajax({url:yith_wcwl_l10n.ajax_url,data:{action:yith_wcwl_l10n.actions.delete_item_action,item_id:i,fragments:C(t)},dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},method:"post",success:function(t){var i=t.fragments,e=t.message;yith_wcwl_l10n.multi_wishlist&&m(e),a.closest(".yith-wcwl-remove-button").length||v(e),void 0!==i&&j(i),h(),r("body").trigger("removed_from_wishlist",[a,o])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=r(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=r(this),i=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');t.is(":checked")?i.attr("checked","checked").change():i.removeAttr("checked").change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=r(this),e=t.closest("form"),a=t.closest(".pp_content"),i=e.serialize();return r.ajax({beforeSend:function(){y(e)},complete:function(){k(e)},data:i+"&action="+yith_wcwl_l10n.actions.ask_an_estimate,dataType:"json",method:"post",success:function(t){if(void 0!==t.result&&t.result){var i=t.template;void 0!==i&&(e.replaceWith(i),a.css("height","auto"),setTimeout(m,3e3))}else void 0!==t.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(r("<div>",{text:t.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var i=r(this),e=r("#yith-wcwl-form");r("html, body").animate({scrollTop:e.offset().top},500),function(t,e){var i=t.data("data-product-id"),a=r(document).find(".cart.wishlist_table"),o=a.data("pagination"),n=a.data("per-page"),s=a.data("id"),d=a.data("token"),l={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:o,per_page:n,wishlist_id:s,wishlist_token:d,add_to_wishlist:i,product_type:t.data("product-type")};if(!x())return alert(yith_wcwl_l10n.labels.cookie_disabled);r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:l,dataType:"html",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=r(t).find("#yith-wcwl-form");e.replaceWith(i),h()}})}(i,e)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,i){var a=r(t.target).data("product_id"),o=i.variation_id,e=r('.add_to_wishlist[data-product-id="'+a+'"]').add('.add_to_wishlist[data-original-product-id="'+a+'"]');a&&o&&e.length&&e.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist");i.attr("data-original-product-id",a),i.attr("data-product-id",o),console.log(i,i.attr("data-product-id")),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass(function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("reset_data",function(t){var o=r(t.target).data("product_id"),i=r('.add_to_wishlist[data-original-product-id="'+o+'"]');o&&i.length&&i.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist"),a=i.attr("data-product-id");i.attr("data-product-id",o),i.attr("data-original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+a).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("yith_wcwl_fragments_loaded",function(t){r(".variations_form").find(".variations select").last().change()}),function(){if(!yith_wcwl_l10n.enable_notices)return;if(r(".yith-wcwl-add-to-wishlist").length&&!r("#yith-wcwl-popup-message").length){var t=r("<div>").attr("id","yith-wcwl-message"),i=r("<div>").attr("id","yith-wcwl-popup-message").html(t).hide();r("body").prepend(i)}}(),n(),d(),l(),function(){var n,s;r(".wishlist_table").on("change",".product-quantity input",function(){var t=r(this),i=t.closest("[data-row-id]"),e=i.data("row-id"),a=t.closest(".wishlist_table"),o=a.data("token");clearTimeout(s),i.find(".add_to_cart").data("quantity",t.val()),s=setTimeout(function(){n&&n.abort(),n=r.ajax({beforeSend:function(){y(a)},complete:function(){k(a)},data:{product_id:e,wishlist_token:o,quantity:t.val(),action:yith_wcwl_l10n.actions.update_item_quantity},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}(),_(),r(document).on("click",".show-tab",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.data("tab"),o=e.find(".tab").filter("."+a);if(t.preventDefault(),!o.length)return!1;i.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===a?e.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):e.find("#new_wishlist_selector").remove()}),r(document).on("change",".wishlist-select",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),o=e.find(".tab.create"),n=e.find(".show-tab"),s=n.filter('[data-tab="create"]');"new"===i.val()&&o.length&&(a.hide(),o.show(),n.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())}),i(),a(),e(),o(),function(){var c=!1;r(window).on("resize",function(t){var i=r(".wishlist_table.responsive"),e=i.is(".mobile"),a=window.matchMedia("(max-width: 768px)"),o=i.closest("form"),n=o.attr("class"),s=o.data("fragment-options"),d={},l=!1;i.length&&(a.matches&&i&&!e?(s.is_mobile="yes",l=!0):!a.matches&&i&&e&&(s.is_mobile="no",l=!0),l&&(c&&c.abort(),d[n]=s,c=r.ajax({beforeSend:function(){y(i)},complete:function(){k(i)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,fragments:d},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url})))})}(),c(),function(){if(!yith_wcwl_l10n.enable_ajax_loading)return;var i=C({firstLoad:!0});if(!i)return;r.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,fragments:i},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments]))},url:yith_wcwl_l10n.ajax_url})}()}).trigger("yith_wcwl_init")});
1
+ jQuery(document).ready(function(r){function i(){void 0!==r.fn.selectBox&&r("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==r.prettyPhoto){var t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),r(".wishlist-select").change(),r(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};r('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(t),r('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=r(this),i=r("#move_to_another_wishlist").find("form"),e=i.find(".row-id"),a=t.closest("[data-row-id]").data("row-id");e.length&&e.remove(),i.append('<input type="hidden" name="row_id" class="row-id" value="'+a+'"/>')}).prettyPhoto(t),new MutationObserver(function(t,i){for(var e in t){var a=t[e];"childList"===a.type&&(void 0!==a.addedNodes&&a.addedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").addClass("yith-wcwl-with-pretty-photo")}),void 0!==a.removedNodes&&a.removedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").removeClass("yith-wcwl-with-pretty-photo")}))}}).observe(document.body,{childList:!0})}}function a(){r(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=r(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function o(){r(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t,i=r(this),e=i.data("icon");t=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?r("<img/>",{src:e}):r("<i/>",{class:"fa "+e}),i.prepend(t).addClass("icon-added")})}function h(){i(),e(),a(),o(),d(),n(),_(),l(),c(),r(document).trigger("yith_wcwl_init_after_ajax")}function n(){yith_wcwl_l10n.enable_tooltip&&r(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=r(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t,i=r(this),e=null,a=i.outerWidth(),o=0;e=r("<span>",{class:"yith-wcwl-tooltip",text:i.data("title")}),i.append(e),t=e.outerWidth()+6,e.outerWidth(t),o=(a-t)/2,e.css({left:o.toFixed(0)+"px"}).fadeIn(200),i.addClass("with-tooltip")}).on("mouseleave",function(){var t=r(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function d(){r(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=r(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=r(this).closest(".with-dropdown"),i=t.find(".yith-wcwl-dropdown");i.length&&i.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&r(".wishlist_table").filter(".sortable").not(".no-interactions").each(function(){var e=r(this),a=!1;e.sortable({items:"[data-row-id]",helper:function(t,i){return i.children().each(function(){r(this).width(r(this).width())}),i},update:function(){var t=e.find("[data-row-id]"),i=[];t.length&&(a&&a.abort(),t.each(function(){var t=r(this);i.push(t.data("row-id"))}),a=r.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,positions:i,wishlist_token:e.data("token"),page:e.data("page"),per_page:e.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function c(){r(".copy-trigger").on("click",function(){var t=r(".copy-target");if(0<t.length)if(t.is("input"))s()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy");else{var i=r("<input/>",{val:t.text(),type:"text"});b("body").append(i),s()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy"),i.remove()}})}function _(){r(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var i=r(this).closest("[data-row-id]"),e=i.siblings("[data-row-id]"),a=i.find(".item-details");t.preventDefault(),a.length&&(e.removeClass("show"),i.toggleClass("show"))}).on("click","[data-row-id] a.close",function(t){var i=r(this).closest("[data-row-id]"),e=i.find(".item-details");t.preventDefault(),e.length&&i.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var i=r(this);return t.stopPropagation(),f(i),!1}).addClass("enhanced"),r(document).on("click",function(t){r(t.target).closest("[data-row-id]").length||r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function w(i,t,e){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&r.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(t){e(t),h(),r("body").trigger("moved_to_another_wishlist",[r(this),i.item_id])}})}function f(i){var t=i.parents(".cart.wishlist_table"),e=i.parents("[data-row-id]"),a=e.data("row-id"),o=t.data("id"),n=t.data("token"),s={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,remove_from_wishlist:a,wishlist_id:o,wishlist_token:n,fragments:T(a)};r.ajax({beforeSend:function(){x(t)},complete:function(){j(t)},data:s,method:"post",success:function(t){void 0!==t.fragments&&P(t.fragments),h(),r("body").trigger("removed_from_wishlist",[i,e])},url:yith_wcwl_l10n.ajax_url})}function p(t){var i=r(this),e=i.closest(".wishlist_table"),a=null;t.preventDefault(),(a=e.length?i.closest("[data-wishlist-id]").find(".wishlist-title"):i.parents(".wishlist-title")).next().show().find('input[type="text"]').focus(),a.hide()}function u(t){var i=r(this);t.preventDefault(),i.parents(".hidden-title-form").hide(),i.parents(".hidden-title-form").prev().show()}function m(t){var i,e=r(this),a=e.closest(".hidden-title-form"),o=e.closest("[data-wishlist-id]").data("wishlist-id"),n=a.find('input[type="text"]'),s=n.val();if(t.preventDefault(),!s)return a.addClass("woocommerce-invalid"),void n.focus();i={action:yith_wcwl_l10n.actions.save_title_action,wishlist_id:o,title:s,fragments:T()},r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",beforeSend:function(){x(a)},complete:function(){j(a)},success:function(t){var i=t.fragments;t.result?(a.hide(),a.prev().find(".wishlist-anchor").text(s).end().show()):(a.addClass("woocommerce-invalid"),n.focus()),void 0!==i&&P(i)}})}function v(t){var i=r(this),e=i.val(),a=i.closest("[data-wishlist-id]").data("wishlist-id"),o={action:yith_wcwl_l10n.actions.save_privacy_action,wishlist_id:a,privacy:e,fragments:T()};r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:o,dataType:"json",success:function(t){var i=t.fragments;void 0!==i&&P(i)}})}function y(t){if(void 0!==r.prettyPhoto&&void 0!==r.prettyPhoto.close)if(void 0!==t){var i=r(".pp_content_container"),e=i.find(".pp_content"),a=i.find(".yith-wcwl-popup-form"),o=a.closest(".pp_pic_holder");if(a.length){var n=r("<div/>",{class:"yith-wcwl-popup-feedback"});n.append(r("<i/>",{class:"fa fa-check heading-icon"})),n.append(r("<p/>",{class:"feedback",html:t})),n.css("display","none"),e.css("height","auto"),a.after(n),a.fadeOut(200,function(){n.fadeIn()}),o.addClass("feedback"),o.css("left",r(window).innerWidth()/2-o.outerWidth()/2+"px"),setTimeout(y,yith_wcwl_l10n.popup_timeout)}}else try{r.prettyPhoto.close()}catch(t){}}function g(t){var i=r("#yith-wcwl-popup-message"),e=r("#yith-wcwl-message"),a=void 0!==yith_wcwl_l10n.popup_timeout?yith_wcwl_l10n.popup_timeout:3e3;void 0!==yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices||(e.html(t),i.css("margin-left","-"+r(i).width()+"px").fadeIn(),window.setTimeout(function(){i.fadeOut()},a))}function k(n){var t=r("select.wishlist-select"),i=r("ul.yith-wcwl-dropdown");t.each(function(){var e=r(this),t=e.find("option"),i=t.filter('[value="new"]');t.not(i).remove(),r.each(n,function(t,i){r("<option>",{value:i.id,html:i.wishlist_name}).appendTo(e)}),e.append(i)}),i.each(function(){var e=r(this),t=e.find("li"),i=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),a=i.attr("data-product-id"),o=i.attr("data-product-type");t.remove(),r.each(n,function(t,i){r("<li>").append(r("<a>",{rel:"nofollow",html:i.wishlist_name,class:"add_to_wishlist",href:i.add_to_this_wishlist_url,"data-product-id":a,"data-product-type":o,"data-wishlist-id":i.id})).appendTo(e)})})}function x(t){void 0!==r.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function j(t){void 0!==r.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function C(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function T(t){var e={},i=null;return t?"object"==typeof t?(i=(t=r.extend({s:"",container:r(document),firstLoad:!1},t)).container.find(".wishlist-fragment"),t.s&&(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(i=i.filter(".on-first-load"))):(i=r(".wishlist-fragment"),"string"!=typeof t&&"number"!=typeof t||(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t+'"]')))):i=r(".wishlist-fragment"),i.each(function(){var t=r(this),i=t.attr("class");e[i]=t.data("fragment-options")}),e}function S(t){if(yith_wcwl_l10n.enable_ajax_loading){var i=T(t=r.extend({firstLoad:!0},t));i&&r.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,fragments:i},method:"post",success:function(t){void 0!==t.fragments&&(P(t.fragments),h(),r(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments]))},url:yith_wcwl_l10n.ajax_url})}}function P(t){r.each(t,function(t,i){var e="."+t.split(" ").filter(function(t){return t.length&&"exists"!==t}).join("."),a=r(e),o=r(i).filter(e);o.length||(o=r(i).find(e)),a.length&&o.length&&a.replaceWith(o)})}function s(){return navigator.userAgent.match(/ipad|iphone/i)}r(document).on("yith_wcwl_init",function(){var t=r(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var a=r(this),i=a.attr("data-product-id"),o=r(".add-to-wishlist-"+i),e={add_to_wishlist:i,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),action:yith_wcwl_l10n.actions.add_to_wishlist_action,fragments:T(i)};if(t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var n=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),s=n.find(".wishlist-select"),d=n.find(".wishlist-name"),l=n.find(".wishlist-visibility").filter(":checked");if(e.wishlist_id=s.is(":visible")?s.val():"new",e.wishlist_name=d.val(),e.wishlist_visibility=l.val(),"new"===e.wishlist_id&&!e.wishlist_name)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid")}if(C())return r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){x(a)},complete:function(){j(a)},success:function(t){var i=t.result,e=t.message;yith_wcwl_l10n.multi_wishlist?(y(e),void 0!==t.user_wishlists&&k(t.user_wishlists)):g(e),"true"!==i&&"exists"!==i||(void 0!==t.fragments&&P(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||o.find(".yith-wcwl-add-button").remove(),o.addClass("exists")),h(),r("body").trigger("added_to_wishlist",[a,o])}}),!1;alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var i=r(this);return t.preventDefault(),f(i),!1}),t.on("adding_to_cart","body",function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=yith_wcwl_l10n.redirect_to_cart))}),t.on("added_to_cart","body",function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=s);var o=a.closest("[data-row-id]"),n=o.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),o.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&n.is_user_owner&&o.remove()}}),t.on("added_to_cart","body",function(){var t=r(".woocommerce-message");0===t.length?r("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){r(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",h),t.on("click",".show-title-form",p),t.on("click",".wishlist-title-with-form h2",p),t.on("click",".remove_from_all_wishlists",function(t){var i=r(this),e=i.attr("data-product-id"),a=i.data("wishlist-id"),o=i.closest(".content"),n={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,prod_id:e,wishlist_id:a,fragments:T(e)};t.preventDefault(),r.ajax({beforeSend:function(){x(o)},complete:function(){j(o)},data:n,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&P(t.fragments),h()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",u),t.on("click",".save-title-form",m),t.on("change",".wishlist_manage_table .wishlist-visibility",v),t.on("change",".change-wishlist",function(){var t=r(this),i=t.parents(".cart.wishlist_table"),e=i.data("token"),a=t.parents("[data-row-id]").data("row-id");w({wishlist_token:e,destination_wishlist_token:t.val(),item_id:a,fragments:T()},function(){x(i)},function(t){void 0!==t.fragments&&P(t.fragments),j(i)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var e=r(this),t=e.attr("data-product-id"),i=e.data("origin-wishlist-id"),a=e.closest("form"),o=a.find(".wishlist-select").val(),n=a.find(".wishlist-name"),s=n.val(),d=a.find(".wishlist-visibility").filter(":checked").val();if("new"===o&&!s)return n.closest("p").addClass("woocommerce-invalid"),!1;n.closest("p").removeClass("woocommerce-invalid"),w({wishlist_token:i,destination_wishlist_token:o,item_id:t,wishlist_name:s,wishlist_visibility:d,fragments:T(t)},function(){x(e)},function(t){var i=t.message;yith_wcwl_l10n.multi_wishlist?(y(i),void 0!==t.user_wishlists&&k(t.user_wishlists)):g(i),void 0!==t.fragments&&P(t.fragments),h(),j(e)})}),t.on("click",".delete_item",function(){var a=r(this),t=a.attr("data-product-id"),i=a.data("item-id"),o=r(".add-to-wishlist-"+t);return r.ajax({url:yith_wcwl_l10n.ajax_url,data:{action:yith_wcwl_l10n.actions.delete_item_action,item_id:i,fragments:T(t)},dataType:"json",beforeSend:function(){x(a)},complete:function(){j(a)},method:"post",success:function(t){var i=t.fragments,e=t.message;yith_wcwl_l10n.multi_wishlist&&y(e),a.closest(".yith-wcwl-remove-button").length||g(e),void 0!==i&&P(i),h(),r("body").trigger("removed_from_wishlist",[a,o])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=r(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=r(this),i=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');t.is(":checked")?i.attr("checked","checked").change():i.removeAttr("checked").change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=r(this),e=t.closest("form"),a=t.closest(".pp_content"),i=e.serialize();return r.ajax({beforeSend:function(){x(e)},complete:function(){j(e)},data:i+"&action="+yith_wcwl_l10n.actions.ask_an_estimate,dataType:"json",method:"post",success:function(t){if(void 0!==t.result&&t.result){var i=t.template;void 0!==i&&(e.replaceWith(i),a.css("height","auto"),setTimeout(y,3e3))}else void 0!==t.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(r("<div>",{text:t.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var i=r(this),e=r("#yith-wcwl-form");r("html, body").animate({scrollTop:e.offset().top},500),function(t,e){var i=t.data("data-product-id"),a=r(document).find(".cart.wishlist_table"),o=a.data("pagination"),n=a.data("per-page"),s=a.data("id"),d=a.data("token"),l={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:o,per_page:n,wishlist_id:s,wishlist_token:d,add_to_wishlist:i,product_type:t.data("product-type")};if(!C())return alert(yith_wcwl_l10n.labels.cookie_disabled);r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:l,dataType:"html",beforeSend:function(){x(a)},complete:function(){j(a)},success:function(t){var i=r(t).find("#yith-wcwl-form");e.replaceWith(i),h()}})}(i,e)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,i){var a=r(t.target).data("product_id"),o=i.variation_id,e=r('.add_to_wishlist[data-product-id="'+a+'"]').add('.add_to_wishlist[data-original-product-id="'+a+'"]');a&&o&&e.length&&e.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist");i.attr("data-original-product-id",a),i.attr("data-product-id",o),console.log(i,i.attr("data-product-id")),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass(function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("reset_data",function(t){var o=r(t.target).data("product_id"),i=r('.add_to_wishlist[data-original-product-id="'+o+'"]');o&&i.length&&i.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist"),a=i.attr("data-product-id");i.attr("data-product-id",o),i.attr("data-original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+a).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("yith_wcwl_reload_fragments",S),t.on("yith_infs_added_elem",function(t,i){S({container:i,firstLoad:!1})}),t.on("yith_wcwl_fragments_loaded",function(t){r(".variations_form").find(".variations select").last().change()}),function(){if(void 0!==yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices)return;if(r(".yith-wcwl-add-to-wishlist").length&&!r("#yith-wcwl-popup-message").length){var t=r("<div>").attr("id","yith-wcwl-message"),i=r("<div>").attr("id","yith-wcwl-popup-message").html(t).hide();r("body").prepend(i)}}(),n(),d(),l(),function(){var n,s;r(".wishlist_table").on("change",".product-quantity input",function(){var t=r(this),i=t.closest("[data-row-id]"),e=i.data("row-id"),a=t.closest(".wishlist_table"),o=a.data("token");clearTimeout(s),i.find(".add_to_cart").data("quantity",t.val()),s=setTimeout(function(){n&&n.abort(),n=r.ajax({beforeSend:function(){x(a)},complete:function(){j(a)},data:{product_id:e,wishlist_token:o,quantity:t.val(),action:yith_wcwl_l10n.actions.update_item_quantity},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}(),_(),r(document).on("click",".show-tab",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.data("tab"),o=e.find(".tab").filter("."+a);if(t.preventDefault(),!o.length)return!1;i.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===a?e.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):e.find("#new_wishlist_selector").remove()}),r(document).on("change",".wishlist-select",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),o=e.find(".tab.create"),n=e.find(".show-tab"),s=n.filter('[data-tab="create"]');"new"===i.val()&&o.length&&(a.hide(),o.show(),n.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())}),i(),a(),e(),o(),function(){var c=!1;r(window).on("resize",function(t){var i=r(".wishlist_table.responsive"),e=i.is(".mobile"),a=window.matchMedia("(max-width: 768px)"),o=i.closest("form"),n=o.attr("class"),s=o.data("fragment-options"),d={},l=!1;i.length&&(a.matches&&i&&!e?(s.is_mobile="yes",l=!0):!a.matches&&i&&e&&(s.is_mobile="no",l=!0),l&&(c&&c.abort(),d[n]=s,c=r.ajax({beforeSend:function(){x(i)},complete:function(){j(i)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,fragments:d},method:"post",success:function(t){void 0!==t.fragments&&(P(t.fragments),h(),r(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url})))})}(),c(),S()}).trigger("yith_wcwl_init")});
assets/js/unminified/jquery.yith-wcwl.js CHANGED
@@ -197,6 +197,10 @@ jQuery( document ).ready( function( $ ){
197
198
t.on( 'click', '.hide-title-form', hide_title_form );
199
200
t.on( 'change', '.change-wishlist', function(){
201
var t = $(this),
202
table = t.parents( '.cart.wishlist_table'),
@@ -482,6 +486,15 @@ jQuery( document ).ready( function( $ ){
482
} );
483
} );
484
485
t.on( 'yith_wcwl_fragments_loaded', function( ev ){
486
$( '.variations_form' ).find( '.variations select' ).last().change();
487
} );
@@ -756,7 +769,7 @@ jQuery( document ).ready( function( $ ){
756
* @since 2.0.0
757
*/
758
function init_wishlist_popup() {
759
- if( ! yith_wcwl_l10n.enable_notices ){
760
return;
761
}
762
@@ -811,7 +824,7 @@ jQuery( document ).ready( function( $ ){
811
return;
812
}
813
814
- $('.wishlist_table').each( function(){
815
var t = $(this),
816
jqxhr = false;
817
@@ -1268,7 +1281,7 @@ jQuery( document ).ready( function( $ ){
1268
title = t.parents( '.wishlist-title' );
1269
}
1270
1271
- title.next().show();
1272
title.hide();
1273
}
1274
@@ -1284,7 +1297,103 @@ jQuery( document ).ready( function( $ ){
1284
ev.preventDefault();
1285
1286
t.parents( '.hidden-title-form').hide();
1287
- t.parents( '.hidden-title-form').prev().show ();
1288
}
1289
1290
/* === UTILS === */
@@ -1343,9 +1452,10 @@ jQuery( document ).ready( function( $ ){
1343
*/
1344
function print_message( response_message ) {
1345
var msgPopup = $( '#yith-wcwl-popup-message' ),
1346
- msg = $( '#yith-wcwl-message' );
1347
1348
- if( ! yith_wcwl_l10n.enable_notices ){
1349
return;
1350
}
1351
@@ -1353,7 +1463,7 @@ jQuery( document ).ready( function( $ ){
1353
msgPopup.css( 'margin-left', '-' + $( msgPopup ).width() + 'px' ).fadeIn();
1354
window.setTimeout( function() {
1355
msgPopup.fadeOut();
1356
- }, yith_wcwl_l10n.popup_timeout );
1357
}
1358
1359
/**
@@ -1467,15 +1577,18 @@ jQuery( document ).ready( function( $ ){
1467
*/
1468
function retrieve_fragments( search ) {
1469
var options = {},
1470
- fragments = $('.wishlist-fragment');
1471
1472
if( search ){
1473
if( typeof search === 'object' ){
1474
search = $.extend( {
1475
s: '',
1476
firstLoad: false
1477
}, search );
1478
1479
if( search.s ){
1480
fragments = fragments.not('[data-fragment-ref]').add(fragments.filter('[data-fragment-ref="' + search.s + '"]'));
1481
}
@@ -1484,10 +1597,17 @@ jQuery( document ).ready( function( $ ){
1484
fragments = fragments.filter( '.on-first-load' );
1485
}
1486
}
1487
- else if( typeof search == 'string' || typeof search == 'number' ) {
1488
- fragments = fragments.not('[data-fragment-ref]').add(fragments.filter('[data-fragment-ref="' + search + '"]'));
1489
}
1490
}
1491
1492
fragments.each( function(){
1493
var t = $(this),
@@ -1502,16 +1622,19 @@ jQuery( document ).ready( function( $ ){
1502
/**
1503
* Load fragments on page loading
1504
*
1505
* @since 3.0.0
1506
*/
1507
- function load_fragments() {
1508
if( ! yith_wcwl_l10n.enable_ajax_loading ){
1509
return;
1510
}
1511
1512
- var fragments = retrieve_fragments( {
1513
firstLoad: true
1514
- } );
1515
1516
if( ! fragments ){
1517
return;
197
198
t.on( 'click', '.hide-title-form', hide_title_form );
199
200
+ t.on( 'click', '.save-title-form', submit_title_form );
201
+
202
+ t.on( 'change', '.wishlist_manage_table .wishlist-visibility', save_privacy );
203
+
204
t.on( 'change', '.change-wishlist', function(){
205
var t = $(this),
206
table = t.parents( '.cart.wishlist_table'),
486
} );
487
} );
488
489
+ t.on( 'yith_wcwl_reload_fragments', load_fragments );
490
+
491
+ t.on( 'yith_infs_added_elem', function( ev, elem ){
492
+ load_fragments( {
493
+ container: elem,
494
+ firstLoad: false
495
+ } );
496
+ } );
497
+
498
t.on( 'yith_wcwl_fragments_loaded', function( ev ){
499
$( '.variations_form' ).find( '.variations select' ).last().change();
500
} );
769
* @since 2.0.0
770
*/
771
function init_wishlist_popup() {
772
+ if( typeof yith_wcwl_l10n.enable_notices != 'undefined' && ! yith_wcwl_l10n.enable_notices ){
773
return;
774
}
775
824
return;
825
}
826
827
+ $('.wishlist_table').filter('.sortable').not('.no-interactions').each( function(){
828
var t = $(this),
829
jqxhr = false;
830
1281
title = t.parents( '.wishlist-title' );
1282
}
1283
1284
+ title.next().show().find('input[type="text"]').focus();
1285
title.hide();
1286
}
1287
1297
ev.preventDefault();
1298
1299
t.parents( '.hidden-title-form').hide();
1300
+ t.parents( '.hidden-title-form').prev().show();
1301
+ }
1302
+
1303
+ /**
1304
+ * Submit form to save a new wishlist title
1305
+ *
1306
+ * @param ev event
1307
+ * @return void
1308
+ * @since 2.0.7
1309
+ */
1310
+ function submit_title_form( ev ) {
1311
+ var t = $(this),
1312
+ form = t.closest( '.hidden-title-form' ),
1313
+ row = t.closest( '[data-wishlist-id]' ),
1314
+ wishlist_id = row.data( 'wishlist-id' ),
1315
+ title_input = form.find( 'input[type="text"]' ),
1316
+ new_title = title_input.val(),
1317
+ data = {};
1318
+
1319
+ ev.preventDefault();
1320
+
1321
+ if( ! new_title ){
1322
+ form.addClass('woocommerce-invalid');
1323
+ title_input.focus();
1324
+ return;
1325
+ }
1326
+
1327
+ data = {
1328
+ action: yith_wcwl_l10n.actions.save_title_action,
1329
+ wishlist_id: wishlist_id,
1330
+ title: new_title,
1331
+ fragments: retrieve_fragments()
1332
+ };
1333
+
1334
+ $.ajax({
1335
+ type: 'POST',
1336
+ url: yith_wcwl_l10n.ajax_url,
1337
+ data: data,
1338
+ dataType: 'json',
1339
+ beforeSend: function(){
1340
+ block( form );
1341
+ },
1342
+ complete: function(){
1343
+ unblock( form );
1344
+ },
1345
+ success: function( response ) {
1346
+ var fragments = response.fragments,
1347
+ status = response.result;
1348
+
1349
+ if( status ) {
1350
+ form.hide();
1351
+ form.prev().find('.wishlist-anchor').text( new_title ).end().show();
1352
+ }
1353
+ else{
1354
+ form.addClass( 'woocommerce-invalid' );
1355
+ title_input.focus();
1356
+ }
1357
+
1358
+ if( typeof fragments != 'undefined' ){
1359
+ replace_fragments( fragments );
1360
+ }
1361
+ }
1362
+ });
1363
+ }
1364
+
1365
+ /**
1366
+ * Submit form to save a new wishlist privacy
1367
+ *
1368
+ * @param ev event
1369
+ * @return void
1370
+ * @since 2.0.7
1371
+ */
1372
+ function save_privacy( ev ){
1373
+ var t = $(this),
1374
+ new_privacy = t.val(),
1375
+ row = t.closest( '[data-wishlist-id]' ),
1376
+ wishlist_id = row.data( 'wishlist-id' ),
1377
+ data = {
1378
+ action: yith_wcwl_l10n.actions.save_privacy_action,
1379
+ wishlist_id: wishlist_id,
1380
+ privacy: new_privacy,
1381
+ fragments: retrieve_fragments()
1382
+ };
1383
+
1384
+ $.ajax({
1385
+ type: 'POST',
1386
+ url: yith_wcwl_l10n.ajax_url,
1387
+ data: data,
1388
+ dataType: 'json',
1389
+ success: function( response ) {
1390
+ var fragments = response.fragments;
1391
+
1392
+ if( typeof fragments != 'undefined' ){
1393
+ replace_fragments( fragments );
1394
+ }
1395
+ }
1396
+ });
1397
}
1398
1399
/* === UTILS === */
1452
*/
1453
function print_message( response_message ) {
1454
var msgPopup = $( '#yith-wcwl-popup-message' ),
1455
+ msg = $( '#yith-wcwl-message' ),
1456
+ timeout = typeof yith_wcwl_l10n.popup_timeout != 'undefined' ? yith_wcwl_l10n.popup_timeout : 3000;
1457
1458
+ if( typeof yith_wcwl_l10n.enable_notices != 'undefined' && ! yith_wcwl_l10n.enable_notices ){
1459
return;
1460
}
1461
1463
msgPopup.css( 'margin-left', '-' + $( msgPopup ).width() + 'px' ).fadeIn();
1464
window.setTimeout( function() {
1465
msgPopup.fadeOut();
1466
+ }, timeout );
1467
}
1468
1469
/**
1577
*/
1578
function retrieve_fragments( search ) {
1579
var options = {},
1580
+ fragments = null;
1581
1582
if( search ){
1583
if( typeof search === 'object' ){
1584
search = $.extend( {
1585
s: '',
1586
+ container: $(document),
1587
firstLoad: false
1588
}, search );
1589
1590
+ fragments = search.container.find( '.wishlist-fragment' );
1591
+
1592
if( search.s ){
1593
fragments = fragments.not('[data-fragment-ref]').add(fragments.filter('[data-fragment-ref="' + search.s + '"]'));
1594
}
1597
fragments = fragments.filter( '.on-first-load' );
1598
}
1599
}
1600
+ else {
1601
+ fragments = $('.wishlist-fragment');
1602
+
1603
+ if (typeof search == 'string' || typeof search == 'number') {
1604
+ fragments = fragments.not('[data-fragment-ref]').add(fragments.filter('[data-fragment-ref="' + search + '"]'));
1605
+ }
1606
}
1607
}
1608
+ else{
1609
+ fragments = $('.wishlist-fragment');
1610
+ }
1611
1612
fragments.each( function(){
1613
var t = $(this),
1622
/**
1623
* Load fragments on page loading
1624
*
1625
+ * @param search string Ref to search among all fragments in the page
1626
* @since 3.0.0
1627
*/
1628
+ function load_fragments( search ) {
1629
if( ! yith_wcwl_l10n.enable_ajax_loading ){
1630
return;
1631
}
1632
1633
+ search = $.extend( {
1634
firstLoad: true
1635
+ }, search );
1636
+
1637
+ var fragments = retrieve_fragments( search );
1638
1639
if( ! fragments ){
1640
return;
includes/class.yith-wcwl-admin.php CHANGED
@@ -155,7 +155,7 @@ if ( ! class_exists( 'YITH_WCWL_Admin' ) ) {
155
// update database
156
YITH_WCWL_Install()->update( $stored_db_version );
157
do_action( 'yith_wcwl_updated' );
158
- }
159
160
// Plugin installed
161
do_action( 'yith_wcwl_installed' );
@@ -234,17 +234,17 @@ if ( ! class_exists( 'YITH_WCWL_Admin' ) ) {
234
* Adds yith-disabled class
235
* Adds class to fields when required, and when disabled state cannot be achieved any other way (eg. by dependencies)
236
*
237
- * @param $classes array Array of field extra classes
238
- * @param $field array Array of field data
239
- *
240
- * @return array Filtered array of extra classes
241
*/
242
public function mark_options_disabled( $classes, $field ) {
243
- if( isset( $field['id'] ) && 'yith_wfbt_enable_integration' == $field['id'] && ! ( defined( 'YITH_WFBT' ) && YITH_WFBT ) ){
244
- $classes[] = 'yith-disabled';
245
- }
246
247
- return $classes;
248
}
249
250
/**
155
// update database
156
YITH_WCWL_Install()->update( $stored_db_version );
157
do_action( 'yith_wcwl_updated' );
158
+ }
159
160
// Plugin installed
161
do_action( 'yith_wcwl_installed' );
234
* Adds yith-disabled class
235
* Adds class to fields when required, and when disabled state cannot be achieved any other way (eg. by dependencies)
236
*
237
+ * @param $classes array Array of field extra classes
238
+ * @param $field array Array of field data
239
+ *
240
+ * @return array Filtered array of extra classes
241
*/
242
public function mark_options_disabled( $classes, $field ) {
243
+ if( isset( $field['id'] ) && 'yith_wfbt_enable_integration' == $field['id'] && ! ( defined( 'YITH_WFBT' ) && YITH_WFBT ) ){
244
+ $classes[] = 'yith-disabled';
245
+ }
246
247
+ return $classes;
248
}
249
250
/**
includes/class.yith-wcwl-ajax-handler.php CHANGED
@@ -58,43 +58,44 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
58
try {
59
YITH_WCWL()->add();
60
61
- $return = 'true';
62
$message = apply_filters( 'yith_wcwl_product_added_to_wishlist_message', get_option( 'yith_wcwl_product_added_text' ) );
63
- }
64
- catch( YITH_WCWL_Exception $e ){
65
- $return = $e->getTextualCode();
66
$message = apply_filters( 'yith_wcwl_error_adding_to_wishlist_message', $e->getMessage() );
67
- }
68
- catch( Exception $e ){
69
- $return = 'error';
70
$message = apply_filters( 'yith_wcwl_error_adding_to_wishlist_message', $e->getMessage() );
71
}
72
73
- $product_id = isset( $_REQUEST['add_to_wishlist'] ) ? intval( $_REQUEST['add_to_wishlist'] ) : false;
74
- $fragments = isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false;
75
$wishlist_url = YITH_WCWL()->get_last_operation_url();
76
77
$wishlists = YITH_WCWL_Wishlist_Factory::get_wishlists();
78
$wishlists_to_prompt = array();
79
80
- foreach( $wishlists as $wishlist ){
81
$wishlists_to_prompt[] = array(
82
- 'id' => $wishlist->get_id(),
83
- 'wishlist_name' => $wishlist->get_formatted_name(),
84
- 'add_to_this_wishlist_url' => $product_id ? add_query_arg( array(
85
- 'add_to_wishlist' => $product_id,
86
- 'wishlist_id' => $wishlist->get_id()
87
- ) ) : ''
88
);
89
}
90
91
- if( in_array( $return, array( 'exists', 'true' ) ) ){
92
// search for related fragments
93
- if( ! empty( $fragments ) && ! empty( $product_id ) ){
94
- foreach( $fragments as $id => $options ){
95
- if( strpos( $id, 'add-to-wishlist-' . $product_id ) ){
96
- $fragments[ $id ]['wishlist_url'] = $wishlist_url;
97
- $fragments[ $id ]['added_to_wishlist'] = $return == 'true';
98
}
99
}
100
}
@@ -102,12 +103,12 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
102
103
wp_send_json(
104
apply_filters( 'yith_wcwl_ajax_add_return_params', array(
105
- 'prod_id' => $product_id,
106
- 'result' => $return,
107
- 'message' => $message,
108
- 'fragments' => self::refresh_fragments( $fragments ),
109
'user_wishlists' => $wishlists_to_prompt,
110
- 'wishlist_url' => $wishlist_url
111
) )
112
);
113
}
@@ -118,18 +119,17 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
118
* @return void
119
*/
120
public static function remove_from_wishlist() {
121
- try{
122
YITH_WCWL()->remove();
123
$message = apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yith-woocommerce-wishlist' ) );
124
- }
125
- catch( Exception $e ){
126
$message = $e->getMessage();
127
}
128
129
wc_add_notice( $message );
130
131
wp_send_json( array(
132
- 'fragments' => self::refresh_fragments( isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false )
133
) );
134
}
135
@@ -142,20 +142,20 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
142
*/
143
public static function delete_item() {
144
$item_id = isset( $_POST['item_id'] ) ? intval( $_POST['item_id'] ) : false;
145
- $return = array(
146
- 'result' => false
147
);
148
149
- if( $item_id ){
150
$item = YITH_WCWL_Wishlist_Factory::get_wishlist_item( $item_id );
151
152
- if( $item ){
153
$item->delete();
154
155
$return = array(
156
- 'result' => true,
157
- 'message' => apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yith-woocommerce-wishlist' ) ),
158
- 'fragments' => YITH_WCWL_Ajax_Handler::refresh_fragments( isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false )
159
);
160
}
161
}
@@ -171,7 +171,7 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
171
*/
172
public static function load_fragments() {
173
wp_send_json( array(
174
- 'fragments' => self::refresh_fragments( isset( $_POST['fragments'] ) ? $_POST['fragments'] : false )
175
) );
176
}
177
@@ -182,29 +182,27 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
182
* @since 1.0.0
183
*/
184
public static function reload_wishlist_and_adding_elem() {
185
- $type_msg = 'success';
186
187
try {
188
YITH_WCWL()->add();
189
$message = apply_filters( 'yith_wcwl_product_added_to_wishlist_message', get_option( 'yith_wcwl_product_added_text' ) );
190
- }
191
- catch( YITH_WCWL_Exception $e ){
192
- $message = $e->getMessage();
193
$type_msg = $e->getTextualCode();
194
- }
195
- catch( Exception $e ){
196
- $message = $e->getMessage();
197
$type_msg = 'error';
198
}
199
200
$wishlist_token = isset( $_REQUEST['wishlist_token'] ) ? $_REQUEST['wishlist_token'] : false;
201
202
$atts = array( 'wishlist_id' => $wishlist_token );
203
- if( isset( $_REQUEST['pagination'] ) ){
204
$atts['pagination'] = $_REQUEST['pagination'];
205
}
206
207
- if( isset( $_REQUEST['per_page'] ) ){
208
$atts['per_page'] = $_REQUEST['per_page'];
209
}
210
@@ -212,7 +210,7 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
212
213
wc_add_notice( $message, $type_msg );
214
215
- echo '<div>'. YITH_WCWL_Shortcode::wishlist( $atts ) . '</div>';
216
217
echo ob_get_clean();
218
die();
@@ -229,10 +227,10 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
229
global $yith_wcwl_is_mobile;
230
231
$fragments = isset( $_POST['fragments'] ) ? $_POST['fragments'] : false;
232
- $result = array();
233
234
- if( ! empty( $fragments ) ){
235
- foreach( $fragments as $id => $options ){
236
$yith_wcwl_is_mobile = isset( $options['is_mobile'] ) ? 'yes' == $options['is_mobile'] : false;
237
238
$result = array_merge( $result, self::refresh_fragments( array( $id => $options ) ) );
@@ -240,7 +238,7 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
240
}
241
242
wp_send_json( array(
243
- 'fragments' => $result
244
) );
245
}
246
@@ -253,16 +251,16 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
253
public static function refresh_fragments( $fragments ) {
254
$result = array();
255
256
- if( ! empty( $fragments ) ){
257
- foreach( $fragments as $id => $options ){
258
$options = YITH_WCWL_Frontend()->decode_fragment_options( $options );
259
- $item = isset( $options['item'] ) ? $options['item'] : false;
260
261
- if( ! $item ){
262
continue;
263
}
264
265
- switch( $item ){
266
case 'add_to_wishlist':
267
case 'wishlist':
268
$result[ $id ] = YITH_WCWL_Shortcode::$item( $options );
@@ -284,4 +282,4 @@ if ( ! class_exists( 'YITH_WCWL_Ajax_Handler' ) ) {
284
}
285
}
286
}
287
- YITH_WCWL_Ajax_Handler::init();
58
try {
59
YITH_WCWL()->add();
60
61
+ $return = 'true';
62
$message = apply_filters( 'yith_wcwl_product_added_to_wishlist_message', get_option( 'yith_wcwl_product_added_text' ) );
63
+ } catch ( YITH_WCWL_Exception $e ) {
64
+ $return = $e->getTextualCode();
65
$message = apply_filters( 'yith_wcwl_error_adding_to_wishlist_message', $e->getMessage() );
66
+ } catch ( Exception $e ) {
67
+ $return = 'error';
68
$message = apply_filters( 'yith_wcwl_error_adding_to_wishlist_message', $e->getMessage() );
69
}
70
71
+ $product_id = isset( $_REQUEST['add_to_wishlist'] ) ? intval( $_REQUEST['add_to_wishlist'] ) : false;
72
+ $fragments = isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false;
73
$wishlist_url = YITH_WCWL()->get_last_operation_url();
74
75
$wishlists = YITH_WCWL_Wishlist_Factory::get_wishlists();
76
+
77
$wishlists_to_prompt = array();
78
79
+ foreach ( $wishlists as $wishlist ) {
80
$wishlists_to_prompt[] = array(
81
+ 'id' => $wishlist->get_id(),
82
+ 'wishlist_name' => $wishlist->get_formatted_name(),
83
+ 'add_to_this_wishlist_url' => $product_id ? add_query_arg(
84
+ array(
85
+ 'add_to_wishlist' => $product_id,
86
+ 'wishlist_id' => $wishlist->get_id(),
87
+ )
88
+ ) : '',
89
);
90
}
91
92
+ if ( in_array( $return, array( 'exists', 'true' ) ) ) {
93
// search for related fragments
94
+ if ( ! empty( $fragments ) && ! empty( $product_id ) ) {
95
+ foreach ( $fragments as $id => $options ) {
96
+ if ( strpos( $id, 'add-to-wishlist-' . $product_id ) ) {
97
+ $fragments[ $id ]['wishlist_url'] = $wishlist_url;
98
+ $fragments[ $id ]['added_to_wishlist'] = 'true' == $return;
99
}
100
}
101
}
103
104
wp_send_json(
105
apply_filters( 'yith_wcwl_ajax_add_return_params', array(
106
+ 'prod_id' => $product_id,
107
+ 'result' => $return,
108
+ 'message' => $message,
109
+ 'fragments' => self::refresh_fragments( $fragments ),
110
'user_wishlists' => $wishlists_to_prompt,
111
+ 'wishlist_url' => $wishlist_url,
112
) )
113
);
114
}
119
* @return void
120
*/
121
public static function remove_from_wishlist() {
122
+ try {
123
YITH_WCWL()->remove();
124
$message = apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yith-woocommerce-wishlist' ) );
125
+ } catch ( Exception $e ) {
126
$message = $e->getMessage();
127
}
128
129
wc_add_notice( $message );
130
131
wp_send_json( array(
132
+ 'fragments' => self::refresh_fragments( isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false ),
133
) );
134
}
135
142
*/
143
public static function delete_item() {
144
$item_id = isset( $_POST['item_id'] ) ? intval( $_POST['item_id'] ) : false;
145
+ $return = array(
146
+ 'result' => false,
147
);
148
149
+ if ( $item_id ) {
150
$item = YITH_WCWL_Wishlist_Factory::get_wishlist_item( $item_id );
151
152
+ if ( $item ) {
153
$item->delete();
154
155
$return = array(
156
+ 'result' => true,
157
+ 'message' => apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yith-woocommerce-wishlist' ) ),
158
+ 'fragments' => YITH_WCWL_Ajax_Handler::refresh_fragments( isset( $_REQUEST['fragments'] ) ? $_REQUEST['fragments'] : false ),
159
);
160
}
161
}
171
*/
172
public static function load_fragments() {
173
wp_send_json( array(
174
+ 'fragments' => self::refresh_fragments( isset( $_POST['fragments'] ) ? $_POST['fragments'] : false ),
175
) );
176
}
177
182
* @since 1.0.0
183
*/
184
public static function reload_wishlist_and_adding_elem() {
185
+ $type_msg = 'success';
186
187
try {
188
YITH_WCWL()->add();
189
$message = apply_filters( 'yith_wcwl_product_added_to_wishlist_message', get_option( 'yith_wcwl_product_added_text' ) );
190
+ } catch ( YITH_WCWL_Exception $e ) {
191
+ $message = $e->getMessage();
192
$type_msg = $e->getTextualCode();
193
+ } catch ( Exception $e ) {
194
+ $message = $e->getMessage();
195
$type_msg = 'error';
196
}
197
198
$wishlist_token = isset( $_REQUEST['wishlist_token'] ) ? $_REQUEST['wishlist_token'] : false;
199
200
$atts = array( 'wishlist_id' => $wishlist_token );
201
+ if ( isset( $_REQUEST['pagination'] ) ) {
202
$atts['pagination'] = $_REQUEST['pagination'];
203
}
204
205
+ if ( isset( $_REQUEST['per_page'] ) ) {
206
$atts['per_page'] = $_REQUEST['per_page'];
207
}
208
210
211
wc_add_notice( $message, $type_msg );
212
213
+ echo '<div>' . YITH_WCWL_Shortcode::wishlist( $atts ) . '</div>';
214
215
echo ob_get_clean();
216
die();
227
global $yith_wcwl_is_mobile;
228
229
$fragments = isset( $_POST['fragments'] ) ? $_POST['fragments'] : false;
230
+ $result = array();
231
232
+ if ( ! empty( $fragments ) ) {
233
+ foreach ( $fragments as $id => $options ) {
234
$yith_wcwl_is_mobile = isset( $options['is_mobile'] ) ? 'yes' == $options['is_mobile'] : false;
235
236
$result = array_merge( $result, self::refresh_fragments( array( $id => $options ) ) );
238
}
239
240
wp_send_json( array(
241
+ 'fragments' => $result,
242
) );
243
}
244
251
public static function refresh_fragments( $fragments ) {
252
$result = array();
253
254
+ if ( ! empty( $fragments ) ) {
255
+ foreach ( $fragments as $id => $options ) {
256
$options = YITH_WCWL_Frontend()->decode_fragment_options( $options );
257
+ $item = isset( $options['item'] ) ? $options['item'] : false;
258
259
+ if ( ! $item ) {
260
continue;
261
}
262
263
+ switch ( $item ) {
264
case 'add_to_wishlist':
265
case 'wishlist':
266
$result[ $id ] = YITH_WCWL_Shortcode::$item( $options );
282
}
283
}
284
}
285
+ YITH_WCWL_Ajax_Handler::init();
includes/class.yith-wcwl-frontend.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
33
* @var string
34
* @since 1.0.0
35
*/
36
- public $version = '3.0.6';
37
38
/**
39
* Plugin database version
@@ -82,9 +82,9 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
82
add_filter( 'option_yith_wcwl_add_to_cart_icon', array( $this, 'update_font_awesome_classes' ) );
83
84
// init class
85
- add_action( 'init', array( $this, 'init' ), 0 );
86
87
- // templates
88
add_action( 'wp_head', array( $this, 'add_button' ) );
89
add_filter( 'body_class', array( $this, 'add_body_class' ) );
90
add_action( 'template_redirect', array( $this, 'add_nocache_headers' ) );
@@ -98,15 +98,15 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
98
99
// scripts
100
add_action( 'wp_head', array( $this, 'detect_javascript' ), 0 );
101
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_stuffs' ) );
102
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
103
104
- // add YITH WooCommerce Frequently Bought Together Premium shortcode
105
- add_action( 'yith_wcwl_after_wishlist_form', array( $this, 'yith_wcfbt_shortcode' ), 10, 1 );
106
add_filter( 'woocommerce_add_to_cart_redirect', array( $this, 'yith_wfbt_redirect_after_add_to_cart' ), 10, 1 );
107
108
- // YITH WCWL Loaded
109
- do_action( 'yith_wcwl_loaded' );
110
}
111
112
/**
@@ -122,8 +122,8 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
122
$this->_convert_cookies_to_session();
123
124
// register assets
125
- $this->register_styles();
126
- $this->register_scripts();
127
}
128
129
/* === ADD TO WISHLIST */
@@ -177,6 +177,16 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
177
* @since 2.2.2
178
*/
179
public function print_button() {
180
echo do_shortcode( "[yith_wcwl_add_to_wishlist]" );
181
}
182
@@ -215,23 +225,23 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
215
}
216
217
/**
218
- * Send nocache headers on wishlist page
219
- *
220
- * @return void
221
- * @since 3.0.0
222
*/
223
public function add_nocache_headers() {
224
- if( ! headers_sent() && yith_wcwl_is_wishlist_page() ){
225
- wc_nocache_headers();
226
- }
227
}
228
229
/* === SCRIPTS AND ASSETS === */
230
231
/**
232
- * Register styles required by the plugin
233
- *
234
- * @return void
235
*/
236
public function register_styles() {
237
$woocommerce_base = WC()->template_path();
@@ -249,7 +259,7 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
249
) );
250
251
if( ! $located ){
252
- wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );
253
}
254
else{
255
$stylesheet_directory = get_stylesheet_directory();
@@ -260,24 +270,24 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
260
$style_url = ( strpos( $located, $stylesheet_directory ) !== false ) ? str_replace( $stylesheet_directory, $stylesheet_directory_uri, $located ) : str_replace( $template_directory, $template_directory_uri, $located );
261
262
wp_register_style( 'yith-wcwl-user-main', $style_url, array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );
263
- }
264
265
// theme specific assets
266
- $current_theme = wp_get_theme();
267
268
if( $current_theme->exists() ){
269
- $theme_slug = $current_theme->Template;
270
271
- if( file_exists( YITH_WCWL_DIR . 'assets/css/themes/' . $theme_slug . '.css' ) ){
272
- wp_register_style( 'yith-wcwl-theme', YITH_WCWL_URL . 'assets/css/themes/' . $theme_slug . '.css', array( $located ? 'yith-wcwl-user-main' : 'yith-wcwl-main' ), $this->version );
273
- }
274
- }
275
}
276
277
/**
278
- * Register scripts required by the plugin
279
- *
280
- * @return void
281
*/
282
public function register_scripts() {
283
$woocommerce_base = WC()->template_path();
@@ -313,8 +323,8 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
313
* @since 1.0.0
314
*/
315
public function enqueue_styles_and_stuffs() {
316
- // libraries
317
- wp_enqueue_style( 'woocommerce_prettyPhoto_css' );
318
wp_enqueue_style( 'jquery-selectBox' );
319
wp_enqueue_style( 'yith-wcwl-font-awesome' );
320
@@ -328,17 +338,17 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
328
329
// theme specific style
330
if( wp_style_is( 'yith-wcwl-theme', 'registered' ) ){
331
- wp_enqueue_style( 'yith-wcwl-theme' );;
332
- }
333
334
// custom style
335
$this->enqueue_custom_style();
336
}
337
338
/**
339
- * Enqueue style dynamically generated by the plugin
340
- *
341
- * @return void
342
*/
343
public function enqueue_custom_style() {
344
$custom_css = $this->_build_custom_css();
@@ -357,7 +367,7 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
357
* @since 1.0.0
358
*/
359
public function enqueue_scripts() {
360
- wp_enqueue_script( 'prettyPhoto' );
361
wp_enqueue_script( 'jquery-selectBox' );
362
363
if ( ! wp_script_is( 'jquery-yith-wcwl-user', 'registered' ) ) {
@@ -369,33 +379,35 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
369
}
370
371
/**
372
- * Return localize array
373
- *
374
- * @return array Array with variables to be localized inside js
375
- * @since 2.2.3
376
*/
377
public function get_localize() {
378
- return apply_filters( 'yith_wcwl_localize_script', array(
379
- 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
380
- 'redirect_to_cart' => get_option( 'yith_wcwl_redirect_cart' ),
381
- 'multi_wishlist' => false,
382
- 'hide_add_button' => apply_filters( 'yith_wcwl_hide_add_button', true ),
383
- 'enable_ajax_loading' => 'yes' == get_option( 'yith_wcwl_ajax_enable', 'no' ),
384
- 'ajax_loader_url' => YITH_WCWL_URL . 'assets/images/ajax-loader-alt.svg',
385
- 'remove_from_wishlist_after_add_to_cart' => get_option( 'yith_wcwl_remove_after_add_to_cart' ) == 'yes',
386
- 'labels' => array(
387
- 'cookie_disabled' => __( 'We are sorry, but this feature is available only if cookies on your browser are enabled.', 'yith-woocommerce-wishlist' ),
388
- 'added_to_cart_message' => sprintf( '<div class="woocommerce-notices-wrapper"><div class="woocommerce-message" role="alert">%s</div></div>', apply_filters( 'yith_wcwl_added_to_cart_message', __( 'Product added to cart successfully', 'yith-woocommerce-wishlist' ) ) )
389
- ),
390
- 'actions' => array(
391
- 'add_to_wishlist_action' => 'add_to_wishlist',
392
- 'remove_from_wishlist_action' => 'remove_from_wishlist',
393
- 'reload_wishlist_and_adding_elem_action' => 'reload_wishlist_and_adding_elem',
394
- 'load_mobile_action' => 'load_mobile',
395
- 'delete_item_action' => 'delete_item',
396
- 'load_fragments' => 'load_fragments'
397
- )
398
- ) );
399
}
400
401
/**
@@ -416,46 +428,46 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
416
417
/* === TEMPLATES === */
418
419
- /**
420
- * Include main wishlist template
421
- *
422
- * @var $var array Array of parameters for current view
423
- * @return void
424
- */
425
public function main_wishlist_content( $var ) {
426
- $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
427
- $layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
428
429
yith_wcwl_get_template_part( $template, '', $layout, $var );
430
- }
431
-
432
- /**
433
- * Include wishlist header template
434
- *
435
- * @var $var array Array of parameters for current view
436
- * @return void
437
- */
438
public function wishlist_header( $var ) {
439
- $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
440
$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
441
442
- yith_wcwl_get_template_part( $template, 'header', $layout, $var );
443
- }
444
445
- /**
446
- * Include wishlist footer template
447
- *
448
- * @var $var array Array of parameters for current view
449
- * @return void
450
- */
451
public function wishlist_footer( $var ) {
452
$template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
453
$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
454
455
yith_wcwl_get_template_part( $template, 'footer', $layout, $var );
456
- }
457
458
- /* === TEMPLATE MODIFICATIONS === */
459
460
/**
461
* Add class to products when Add to Wishlist is shown on loop
@@ -488,90 +500,90 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
488
489
/* === UTILS === */
490
491
- /**
492
- * Format options that will sent through AJAX calls to refresh arguments
493
- *
494
- * @param $options array Array of options
495
- * @param $context string Widget/Shortcode that will use the options
496
- * @return array Array of formatted options
497
- * @since 3.0.0
498
- */
499
public function format_fragment_options( $options, $context = '' ) {
500
- // removes unusable values, and changes options common for all fragments
501
- if( ! empty( $options ) ){
502
- foreach( $options as $id => $value ){
503
- if( is_object( $value ) || is_array( $value ) ){
504
- // remove item if type is not supported
505
- unset( $options[ $id ] );
506
- }
507
- elseif( 'ajax_loading' == $id ){
508
- $options['ajax_loading'] = false;
509
- }
510
- }
511
- }
512
513
- // applies context specific changes
514
- if( ! empty( $context ) ){
515
- $options['item'] = $context;
516
-
517
- switch( $context ) {
518
- case 'add_to_wishlist':
519
- unset( $options['template_part'] );
520
- unset( $options['label'] );
521
- unset( $options['exists'] );
522
- unset( $options['icon'] );
523
- unset( $options['link_classes'] );
524
- unset( $options['link_popup_classes'] );
525
- unset( $options['container_classes'] );
526
- unset( $options['found_in_list'] );
527
- unset( $options['found_item'] );
528
- unset( $options['popup_title'] );
529
- break;
530
- }
531
- }
532
533
- return $options;
534
- }
535
536
- /**
537
- * Decode options that comes from the fragment
538
- *
539
- * @param $options array Options for the fragments
540
- * @return array Filtered options for the fragment
541
- */
542
public function decode_fragment_options( $options ) {
543
- if( ! empty( $options ) ){
544
- foreach( $options as $id => $value ){
545
- if( 'true' == $value ){
546
- $options[ $id ] = true;
547
- }
548
- elseif( 'false' == $value ){
549
- $options[ $id ] = false;
550
- }
551
- }
552
- }
553
554
- return $options;
555
- }
556
557
/**
558
* Alter add to cart button when on wishlist page
559
- *
560
- * @return void
561
- * @since 2.0.0
562
- * @version 3.0.0
563
*/
564
public function alter_add_to_cart_button(){
565
- add_filter( 'woocommerce_loop_add_to_cart_args', array( $this, 'alter_add_to_cart_args' ) );
566
- add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'alter_add_to_cart_text' ), 10, 2 );
567
- add_filter( 'woocommerce_product_add_to_cart_url', array( $this, 'alter_add_to_cart_url' ), 10, 2 );
568
}
569
570
/**
571
- * Restore default Add to Cart button, after wishlist handling
572
- *
573
- * @return void
574
- * @since 3.0.0
575
*/
576
public function restore_add_to_cart_button() {
577
remove_filter( 'woocommerce_loop_add_to_cart_args', array( $this, 'alter_add_to_cart_args' ) );
@@ -582,51 +594,51 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
582
/**
583
* Changes arguments used to print Add to Cart button on wishlist (classes and attributes)
584
*
585
- * @param $args array Array of arguments
586
- * @return array Array of filtered arguments
587
- * @since 3.0.0
588
*/
589
public function alter_add_to_cart_args( $args ) {
590
$use_custom_button = get_option( 'yith_wcwl_add_to_cart_style' );
591
$button_class = in_array( $use_custom_button, array( 'button_custom', 'button_default' ) );
592
$icon = get_option( 'yith_wcwl_add_to_cart_icon' );
593
$custom_icon = get_option( 'yith_wcwl_add_to_cart_custom_icon' );
594
- $classes = isset( $args['class'] ) ? explode( ' ', $args['class'] ) : array();
595
596
- if( ! $button_class && $pos = array_search( 'button', $classes ) !== false ){
597
- unset( $classes[ $pos ] );
598
- }
599
- elseif( $button_class ){
600
- $classes[] = 'button';
601
- }
602
603
- $classes[] = 'add_to_cart';
604
- $classes[] = 'alt';
605
606
- $args['class'] = implode( ' ', $classes );
607
608
if( 'button_custom' == $use_custom_button && $icon != 'none' ) {
609
if( ! isset( $args['attributes'] ) ){
610
$args['attributes'] = array();
611
- }
612
613
if( $icon != 'custom' ) {
614
$args['attributes']['data-icon'] = $icon;
615
}
616
elseif( $custom_icon ){
617
$args['attributes']['data-icon'] = $custom_icon;
618
- }
619
}
620
621
- return $args;
622
}
623
624
/**
625
- * Filter Add to Cart button label on wishlist page
626
- *
627
- * @param $text string Button label
628
- * @param \WC_Product Current product
629
- * @return string Filtered label
630
*/
631
public function alter_add_to_cart_text( $text, $product ) {
632
$label_option = get_option( 'yith_wcwl_add_to_cart_text', __( 'Add to cart', 'yith-woocommerce-wishlist' ) );
@@ -636,50 +648,50 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
636
}
637
638
/**
639
- * Filter Add to Cart button url on wishlist page
640
- *
641
- * @param $url string Url to the Add to Cart
642
- * @param $product \WC_Product Current product
643
- * @return string Filtered url
644
*/
645
public function alter_add_to_cart_url( $url, $product ) {
646
- global $yith_wcwl_wishlist_token;
647
-
648
- if( $yith_wcwl_wishlist_token ){
649
- $wishlist = yith_wcwl_get_wishlist( $yith_wcwl_wishlist_token );
650
-
651
- if( ! $wishlist ){
652
- return $url;
653
- }
654
-
655
- $wishlist_id = $wishlist->get_id();
656
- $item = $wishlist->get_product( $product->get_id() );
657
-
658
- if( wp_doing_ajax() ){
659
- $url = add_query_arg( 'add-to-cart', $product->get_id(), YITH_WCWL()->get_wishlist_url( 'view/' . $yith_wcwl_wishlist_token ) );
660
- }
661
-
662
- if( $product->is_type( array( 'simple', 'variation' ) ) && get_option( 'yith_wcwl_redirect_cart' ) == 'yes' ){
663
- $url = add_query_arg( 'add-to-cart', $product->get_id(), wc_get_cart_url() );
664
- }
665
-
666
- if( ! $product->is_type( 'external' ) && get_option( 'yith_wcwl_remove_after_add_to_cart' ) == 'yes' ){
667
- $url = add_query_arg(
668
- array(
669
- 'remove_from_wishlist_after_add_to_cart' => $product->get_id(),
670
- 'wishlist_id' => $wishlist_id,
671
- 'wishlist_token' => $yith_wcwl_wishlist_token
672
- ),
673
- $url
674
- );
675
- }
676
-
677
- if( $item && 'yes' == get_option( 'yith_wcwl_quantity_show' ) ){
678
- $url = add_query_arg( 'quantity', $item->get_quantity(), $url );
679
- }
680
- }
681
682
- return apply_filters( 'yit_wcwl_add_to_cart_redirect_url', esc_url_raw( $url ), $url, $product );
683
}
684
685
/**
@@ -819,421 +831,425 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
819
}
820
821
/**
822
- * Generate CSS code to append to each page, to apply custom style to wishlist elements
823
*
824
* @param $rules array Array of additional rules to add to default ones
825
* @return string Generated CSS code
826
*/
827
protected function _build_custom_css( $rules = array() ){
828
- $generated_code = '';
829
- $rules = apply_filters( 'yith_wcwl_custom_css_rules', array_merge( array(
830
- 'color_add_to_wishlist' => array(
831
- 'selector' => '.woocommerce a.add_to_wishlist.button.alt',
832
- 'rules' => array(
833
- 'background' => array(
834
- 'rule' => 'background-color: %1$s; background: %1$s',
835
- 'default' => '#333333'
836
- ),
837
- 'text' => array(
838
- 'rule' => 'color: %s',
839
- 'default' => '#ffffff'
840
- ),
841
- 'border' => array(
842
- 'rule' => 'border-color: %s',
843
- 'default' => '#333333'
844
- ),
845
- 'background_hover' => array(
846
- 'rule' => 'background-color: %1$s; background: %1$s',
847
- 'default' => '#4F4F4F',
848
- 'status' => ':hover'
849
- ),
850
- 'text_hover' => array(
851
- 'rule' => 'color: %s',
852
- 'default' => '#ffffff',
853
- 'status' => ':hover'
854
- ),
855
- 'border_hover' => array(
856
- 'rule' => 'border-color: %s',
857
- 'default' => '#4F4F4F',
858
- 'status' => ':hover'
859
- )
860
- ),
861
- 'deps' => array(
862
- 'yith_wcwl_add_to_wishlist_style' => 'button_custom'
863
- )
864
- ),
865
- 'rounded_corners_radius' => array(
866
- 'selector' => '.woocommerce a.add_to_wishlist.button.alt',
867
- 'rules' => array(
868
- 'rule' => 'border-radius: %dpx',
869
- 'default' => 16
870
- ),
871
- 'deps' => array(
872
- 'yith_wcwl_add_to_wishlist_style' => 'button_custom'
873
- )
874
- ),
875
- 'color_add_to_cart' => array(
876
- 'selector' => '.woocommerce .wishlist_table a.add_to_cart.button.alt',
877
- 'rules' => array(
878
- 'background' => array(
879
- 'rule' => 'background: %1$s; background-color: %1$s;',
880
- 'default' => '#333333'
881
- ),
882
- 'text' => array(
883
- 'rule' => 'color: %s',
884
- 'default' => '#ffffff'
885
- ),
886
- 'border' => array(
887
- 'rule' => 'border-color: %s',
888
- 'default' => '#333333'
889
- ),
890
- 'background_hover' => array(
891
- 'rule' => 'background: %1$s; background-color: %1$s;',
892
- 'default' => '#4F4F4F',
893
- 'status' => ':hover'
894
- ),
895
- 'text_hover' => array(
896
- 'rule' => 'color: %s',
897
- 'default' => '#ffffff',
898
- 'status' => ':hover'
899
- ),
900
- 'border_hover' => array(
901
- 'rule' => 'border-color: %s',
902
- 'default' => '#4F4F4F',
903
- 'status' => ':hover'
904
- )
905
- ),
906
- 'deps' => array(
907
- 'yith_wcwl_add_to_cart_style' => 'button_custom'
908
- )
909
- ),
910
- 'add_to_cart_rounded_corners_radius' => array(
911
- 'selector' => '.woocommerce .wishlist_table a.add_to_cart.button.alt',
912
- 'rules' => array(
913
- 'rule' => 'border-radius: %dpx',
914
- 'default' => 16
915
- ),
916
- 'deps' => array(
917
- 'yith_wcwl_add_to_cart_style' => 'button_custom',
918
- )
919
- ),
920
- 'color_button_style_1' => array(
921
- 'selector' => '.woocommerce .hidden-title-form button,
922
- .yith-wcwl-wishlist-new .create-wishlist-button,
923
- .wishlist_manage_table tfoot button.submit-wishlist-changes,
924
- .yith-wcwl-wishlist-search-form button.wishlist-search-button',
925
- 'rules' => array(
926
- 'background' => array(
927
- 'rule' => 'background: %1$s; background-color: %1$s;',
928
- 'default' => '#333333'
929
- ),
930
- 'text' => array(
931
- 'rule' => 'color: %s',
932
- 'default' => '#ffffff'
933
- ),
934
- 'border' => array(
935
- 'rule' => 'border-color: %s',
936
- 'default' => '#333333'
937
- ),
938
- 'background_hover' => array(
939
- 'rule' => 'background: %1$s; background-color: %1$s;',
940
- 'default' => '#333333',
941
- 'status' => ':hover'
942
- ),
943
- 'text_hover' => array(
944
- 'rule' => 'color: %s',
945
- 'default' => '#ffffff',
946
- 'status' => ':hover'
947
- ),
948
- 'border_hover' => array(
949
- 'rule' => 'border-color: %s',
950
- 'default' => '#333333',
951
- 'status' => ':hover'
952
- )
953
- ),
954
- 'deps' => array(
955
- 'yith_wcwl_add_to_cart_style' => 'button_custom'
956
- )
957
- ),
958
- 'color_button_style_2' => array(
959
- 'selector' => '.woocommerce .wishlist-title a.show-title-form,
960
- .woocommerce .hidden-title-form a.hide-title-form,
961
- .wishlist_manage_table tfoot a.create-new-wishlist',
962
- 'rules' => array(
963
- 'background' => array(
964
- 'rule' => 'background: %1$s; background-color: %1$s;',
965
- 'default' => '#333333'
966
- ),
967
- 'text' => array(
968
- 'rule' => 'color: %s',
969
- 'default' => '#ffffff'
970
- ),
971
- 'border' => array(
972
- 'rule' => 'border-color: %s',
973
- 'default' => '#333333'
974
- ),
975
- 'background_hover' => array(
976
- 'rule' => 'background: %1$s; background-color: %1$s;',
977
- 'default' => '#333333',
978
- 'status' => ':hover'
979
- ),
980
- 'text_hover' => array(
981
- 'rule' => 'color: %s',
982
- 'default' => '#ffffff',
983
- 'status' => ':hover'
984
- ),
985
- 'border_hover' => array(
986
- 'rule' => 'border-color: %s',
987
- 'default' => '#333333',
988
- 'status' => ':hover'
989
- )
990
- ),
991
- 'deps' => array(
992
- 'yith_wcwl_add_to_cart_style' => 'button_custom'
993
- )
994
- ),
995
- 'color_wishlist_table' => array(
996
- 'selector' => '.woocommerce table.shop_table.wishlist_table',
997
- 'rules' => array(
998
- 'background' => array(
999
- 'rule' => 'background: %1$s; background-color: %1$s;',
1000
- 'default' => '#FFFFFF'
1001
- ),
1002
- 'text' => array(
1003
- 'rule' => 'color: %s',
1004
- 'default' => '#6D6C6C'
1005
- ),
1006
- 'border' => array(
1007
- 'rule' => 'background: %1$s; background-color: %1$s;',
1008
- 'default' => '#FFFFFF'
1009
- )
1010
- ),
1011
- 'deps' => array(
1012
- 'yith_wcwl_add_to_cart_style' => 'button_custom'
1013
- )
1014
- ),
1015
- 'color_headers_background' => array(
1016
- 'selector' => '.wishlist_table thead,
1017
- .wishlist_table tfoot,
1018
- .widget_yith-wcwl-lists ul.dropdown li.current a,
1019
- .widget_yith-wcwl-lists ul.dropdown li a:hover,
1020
- .selectBox-dropdown-menu.selectBox-options li.selectBox-selected a,
1021
- .selectBox-dropdown-menu.selectBox-options li.selectBox-hover a',
1022
- 'rules' => array(
1023
- 'rule' => 'background: %1$s; background-color: %1$s;',
1024
- 'default' => '#F4F4F4'
1025
- ),
1026
- 'deps' => array(
1027
- 'yith_wcwl_add_to_cart_style' => 'button_custom'
1028
- )
1029
- ),
1030
- 'color_share_button' => array(
1031
- 'selector' => '.yith-wcwl-share li a',
1032
- 'rules' => array(
1033
- 'color' => array(
1034
- 'rule' => 'color: %s;',
1035
- 'default' => '#FFFFFF'
1036
- ),
1037
- 'color_hover' => array(
1038
- 'rule' => 'color: %s;',
1039
- 'status' => ':hover',
1040
- 'default' => '#FFFFFF'
1041
- )
1042
- ),
1043
- 'deps' => array(
1044
- 'yith_wcwl_enable_share' => 'yes'
1045
- )
1046
- ),
1047
- 'color_fb_button' => array(
1048
- 'selector' => '.yith-wcwl-share a.facebook',
1049
- 'rules' => array(
1050
- 'background' => array(
1051
- 'rule' => 'background: %1$s; background-color: %1$s;',
1052
- 'default' => '#39599E'
1053
- ),
1054
- 'background_hover' => array(
1055
- 'rule' => 'background: %1$s; background-color: %1$s;',
1056
- 'status' => ':hover',
1057
- 'default' => '#39599E'
1058
- )
1059
- ),
1060
- 'deps' => array(
1061
- 'yith_wcwl_enable_share' => 'yes',
1062
- 'yith_wcwl_share_fb' => 'yes',
1063
- )
1064
- ),
1065
- 'color_tw_button' => array(
1066
- 'selector' => '.yith-wcwl-share a.twitter',
1067
- 'rules' => array(
1068
- 'background' => array(
1069
- 'rule' => 'background: %1$s; background-color: %1$s;',
1070
- 'default' => '#45AFE2'
1071
- ),
1072
- 'background_hover' => array(
1073
- 'rule' => 'background: %1$s; background-color: %1$s;',
1074
- 'status' => ':hover',
1075
- 'default' => '#39599E'
1076
- )
1077
- ),
1078
- 'deps' => array(
1079
- 'yith_wcwl_enable_share' => 'yes',
1080
- 'yith_wcwl_share_twitter' => 'yes',
1081
- )
1082
- ),
1083
- 'color_pr_button' => array(
1084
- 'selector' => '.yith-wcwl-share a.pinterest',
1085
- 'rules' => array(
1086
- 'background' => array(
1087
- 'rule' => 'background: %1$s; background-color: %1$s;',
1088
- 'default' => '#AB2E31'
1089
- ),
1090
- 'background_hover' => array(
1091
- 'rule' => 'background: %1$s; background-color: %1$s;',
1092
- 'status' => ':hover',
1093
- 'default' => '#39599E'
1094
- )
1095
- ),
1096
- 'deps' => array(
1097
- 'yith_wcwl_enable_share' => 'yes',
1098
- 'yith_wcwl_share_pinterest' => 'yes',
1099
- )
1100
- ),
1101
- 'color_em_button' => array(
1102
- 'selector' => '.yith-wcwl-share a.email',
1103
- 'rules' => array(
1104
- 'background' => array(
1105
- 'rule' => 'background: %1$s; background-color: %1$s;',
1106
- 'default' => '#FBB102'
1107
- ),
1108
- 'background_hover' => array(
1109
- 'rule' => 'background: %1$s; background-color: %1$s;',
1110
- 'status' => ':hover',
1111
- 'default' => '#39599E'
1112
- )
1113
- ),
1114
- 'deps' => array(
1115
- 'yith_wcwl_enable_share' => 'yes',
1116
- 'yith_wcwl_share_email' => 'yes',
1117
- )
1118
- ),
1119
- 'color_wa_button' => array(
1120
- 'selector' => '.yith-wcwl-share a.whatsapp',
1121
- 'rules' => array(
1122
- 'background' => array(
1123
- 'rule' => 'background: %1$s; background-color: %1$s;',
1124
- 'default' => '#00A901'
1125
- ),
1126
- 'background_hover' => array(
1127
- 'rule' => 'background: %1$s; background-color: %1$s;',
1128
- 'status' => ':hover',
1129
- 'default' => '#39599E'
1130
- )
1131
- ),
1132
- 'deps' => array(
1133
- 'yith_wcwl_enable_share' => 'yes',
1134
- 'yith_wcwl_share_whatsapp' => 'yes',
1135
- )
1136
- ),
1137
- ), $rules ) );
1138
-
1139
- if( empty( $rules ) ){
1140
- return $generated_code;
1141
- }
1142
1143
- // retrieve dependencies
1144
$deps_list = wp_list_pluck( $rules, 'deps' );
1145
$dependencies = array();
1146
1147
if( ! empty( $deps_list ) ){
1148
- foreach( $deps_list as $rule => $deps ){
1149
- foreach( $deps as $dep_rule => $dep_value ){
1150
- if( ! isset( $dependencies[ $dep_rule ] ) ){
1151
- $dependencies[ $dep_rule ] = get_option( $dep_rule );
1152
- }
1153
- }
1154
- }
1155
- }
1156
1157
- foreach( $rules as $id => $rule ){
1158
- // check dependencies first
1159
- if( ! empty( $rule['deps'] ) ){
1160
- foreach( $rule['deps'] as $dep_rule => $dep_value ){
1161
- if( ! isset( $dependencies[ $dep_rule ] ) || $dependencies[ $dep_rule ] != $dep_value ){
1162
- continue 2;
1163
- }
1164
- }
1165
- }
1166
-
1167
- // retrieve values from db
1168
- $values = get_option( "yith_wcwl_{$id}" );
1169
- $new_rules = array();
1170
- $rules_code = '';
1171
-
1172
- // if we have a single-valued option, just search for the rule to apply
1173
- if( isset( $rule['rules']['rule'] ) ){
1174
- $status = isset( $rule['rules']['status'] ) ? $rule['rules']['status'] : '';
1175
-
1176
- if( ! isset( $new_rules[ $status ] ) ){
1177
- $new_rules[ $status ] = array();
1178
- }
1179
-
1180
- $new_rules[ $status ][] = $this->_build_css_rule( $rule['rules']['rule'], $values, $rule['rules']['default'] );
1181
- }
1182
-
1183
- // otherwise cycle through rules, and generate CSS code
1184
- else{
1185
- foreach( $rule['rules'] as $property => $css ){
1186
- $status = isset( $css['status'] ) ? $css['status'] : '';
1187
-
1188
- if( ! isset( $new_rules[ $status ] ) ){
1189
- $new_rules[ $status ] = array();
1190
- }
1191
-
1192
- $new_rules[ $status ][] = $this->_build_css_rule( $css['rule'], isset( $values[ $property ] ) ? $values[ $property ] : false, $css['default'] );
1193
- }
1194
- }
1195
-
1196
- // if code was generated, prepend selector
1197
- if( ! empty( $new_rules ) ){
1198
- foreach( $new_rules as $status => $rules ){
1199
- $selector = $rule['selector'];
1200
-
1201
- if( ! empty( $status ) ){
1202
- $updated_selector = array();
1203
- $split_selectors = explode( ',', $rule['selector'] );
1204
-
1205
- foreach( $split_selectors as $split_selector ){
1206
- $updated_selector[] = $split_selector . $status;
1207
- }
1208
-
1209
- $selector = implode( ',', $updated_selector );
1210
- }
1211
-
1212
- $rules_code .= $selector . '{' . implode( '', $rules ) . '}';
1213
- }
1214
- }
1215
-
1216
- // append new rule to generated CSS
1217
- $generated_code .= $rules_code;
1218
- }
1219
1220
- return $generated_code;
1221
- }
1222
1223
- /**
1224
- * Generate each single CSS rule that will be included in custom plugin CSS
1225
- *
1226
- * @param $rule string Rule to use; placeholders may be applied to be replaced with value {@see sprintf}
1227
- * @param $value string Value to inject inside rule, replacing placeholders
1228
- * @param $default string Default value, to be used instead of value when it is empty
1229
- *
1230
- * @return string Formatted CSS rule
1231
- */
1232
- protected function _build_css_rule( $rule, $value, $default = '' ){
1233
- $value = ( '0' === $value || ( ! empty( $value ) && ! is_array( $value ) ) ) ? $value : $default;
1234
1235
- return sprintf( rtrim( $rule, ';' ) . ';', $value );
1236
- }
1237
1238
/**
1239
* Destroy serialize cookies, to prevent major vulnerability
@@ -1278,39 +1294,39 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
1278
}
1279
1280
/**
1281
- * Convert wishlist stored into cookies into
1282
*/
1283
protected function _convert_cookies_to_session(){
1284
$cookie = yith_getcookie( 'yith_wcwl_products' );
1285
1286
- if( ! empty( $cookie ) ){
1287
1288
- $default_list = YITH_WCWL_Wishlist_Factory::get_default_wishlist();
1289
1290
- if( ! $default_list ){
1291
- return false;
1292
- }
1293
1294
- foreach ( $cookie as $item ){
1295
- if( $default_list->has_product( $item['prod_id'] ) ){
1296
- continue;
1297
- }
1298
1299
- $new_item = new YITH_WCWL_Wishlist_Item();
1300
1301
- $new_item->set_product_id( $item['prod_id'] );
1302
- $new_item->set_quantity( $item['quantity'] );
1303
1304
- if( isset( $item['dateadded'] ) ){
1305
- $new_item->set_date_added( $item['dateadded'] );
1306
- }
1307
1308
- $default_list->add_item( $new_item );
1309
- }
1310
1311
- $default_list->save();
1312
1313
- yith_destroycookie( 'yith_wcwl_products' );
1314
}
1315
}
1316
}
33
* @var string
34
* @since 1.0.0
35
*/
36
+ public $version = '3.0.7';
37
38
/**
39
* Plugin database version
82
add_filter( 'option_yith_wcwl_add_to_cart_icon', array( $this, 'update_font_awesome_classes' ) );
83
84
// init class
85
+ add_action( 'init', array( $this, 'init' ), 0 );
86
87
+ // templates
88
add_action( 'wp_head', array( $this, 'add_button' ) );
89
add_filter( 'body_class', array( $this, 'add_body_class' ) );
90
add_action( 'template_redirect', array( $this, 'add_nocache_headers' ) );
98
99
// scripts
100
add_action( 'wp_head', array( $this, 'detect_javascript' ), 0 );
101
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_stuffs' ) );
102
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
103
104
+ // add YITH WooCommerce Frequently Bought Together Premium shortcode
105
+ add_action( 'yith_wcwl_after_wishlist_form', array( $this, 'yith_wcfbt_shortcode' ), 10, 1 );
106
add_filter( 'woocommerce_add_to_cart_redirect', array( $this, 'yith_wfbt_redirect_after_add_to_cart' ), 10, 1 );
107
108
+ // YITH WCWL Loaded
109
+ do_action( 'yith_wcwl_loaded' );
110
}
111
112
/**
122
$this->_convert_cookies_to_session();
123
124
// register assets
125
+ $this->register_styles();
126
+ $this->register_scripts();
127
}
128
129
/* === ADD TO WISHLIST */
177
* @since 2.2.2
178
*/
179
public function print_button() {
180
+ /**
181
+ * Developers can use this filter to remove ATW button selectively from specific pages or products
182
+ * You can use global $product or $post to execute checks
183
+ *
184
+ * @since 3.0.7
185
+ */
186
+ if( ! apply_filters( 'yith_wcwl_show_add_to_wishlist', true ) ){
187
+ return;
188
+ }
189
+
190
echo do_shortcode( "[yith_wcwl_add_to_wishlist]" );
191
}
192
225
}
226
227
/**
228
+ * Send nocache headers on wishlist page
229
+ *
230
+ * @return void
231
+ * @since 3.0.0
232
*/
233
public function add_nocache_headers() {
234
+ if( ! headers_sent() && yith_wcwl_is_wishlist_page() ){
235
+ wc_nocache_headers();
236
+ }
237
}
238
239
/* === SCRIPTS AND ASSETS === */
240
241
/**
242
+ * Register styles required by the plugin
243
+ *
244
+ * @return void
245
*/
246
public function register_styles() {
247
$woocommerce_base = WC()->template_path();
259
) );
260
261
if( ! $located ){
262
+ wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );
263
}
264
else{
265
$stylesheet_directory = get_stylesheet_directory();
270
$style_url = ( strpos( $located, $stylesheet_directory ) !== false ) ? str_replace( $stylesheet_directory, $stylesheet_directory_uri, $located ) : str_replace( $template_directory, $template_directory_uri, $located );
271
272
wp_register_style( 'yith-wcwl-user-main', $style_url, array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );
273
+ }
274
275
// theme specific assets
276
+ $current_theme = wp_get_theme();
277
278
if( $current_theme->exists() ){
279
+ $theme_slug = $current_theme->Template;
280
281
+ if( file_exists( YITH_WCWL_DIR . 'assets/css/themes/' . $theme_slug . '.css' ) ){
282
+ wp_register_style( 'yith-wcwl-theme', YITH_WCWL_URL . 'assets/css/themes/' . $theme_slug . '.css', array( $located ? 'yith-wcwl-user-main' : 'yith-wcwl-main' ), $this->version );
283
+ }
284
+ }
285
}
286
287
/**
288
+ * Register scripts required by the plugin
289
+ *
290
+ * @return void
291
*/
292
public function register_scripts() {
293
$woocommerce_base = WC()->template_path();
323
* @since 1.0.0
324
*/
325
public function enqueue_styles_and_stuffs() {
326
+ // libraries
327
+ wp_enqueue_style( 'woocommerce_prettyPhoto_css' );
328
wp_enqueue_style( 'jquery-selectBox' );
329
wp_enqueue_style( 'yith-wcwl-font-awesome' );
330
338
339
// theme specific style
340
if( wp_style_is( 'yith-wcwl-theme', 'registered' ) ){
341
+ wp_enqueue_style( 'yith-wcwl-theme' );;
342
+ }
343
344
// custom style
345
$this->enqueue_custom_style();
346
}
347
348
/**
349
+ * Enqueue style dynamically generated by the plugin
350
+ *
351
+ * @return void
352
*/
353
public function enqueue_custom_style() {
354
$custom_css = $this->_build_custom_css();
367
* @since 1.0.0
368
*/
369
public function enqueue_scripts() {
370
+ wp_enqueue_script( 'prettyPhoto' );
371
wp_enqueue_script( 'jquery-selectBox' );
372
373
if ( ! wp_script_is( 'jquery-yith-wcwl-user', 'registered' ) ) {
379
}
380
381
/**
382
+ * Return localize array
383
+ *
384
+ * @return array Array with variables to be localized inside js
385
+ * @since 2.2.3
386
*/
387
public function get_localize() {
388
+ return apply_filters( 'yith_wcwl_localize_script', array(
389
+ 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
390
+ 'redirect_to_cart' => get_option( 'yith_wcwl_redirect_cart' ),
391
+ 'multi_wishlist' => false,
392
+ 'hide_add_button' => apply_filters( 'yith_wcwl_hide_add_button', true ),
393
+ 'enable_ajax_loading' => 'yes' == get_option( 'yith_wcwl_ajax_enable', 'no' ),
394
+ 'ajax_loader_url' => YITH_WCWL_URL . 'assets/images/ajax-loader-alt.svg',
395
+ 'remove_from_wishlist_after_add_to_cart' => get_option( 'yith_wcwl_remove_after_add_to_cart' ) == 'yes',
396
+ 'labels' => array(
397
+ 'cookie_disabled' => __( 'We are sorry, but this feature is available only if cookies on your browser are enabled.', 'yith-woocommerce-wishlist' ),
398
+ 'added_to_cart_message' => sprintf( '<div class="woocommerce-notices-wrapper"><div class="woocommerce-message" role="alert">%s</div></div>', apply_filters( 'yith_wcwl_added_to_cart_message', __( 'Product added to cart successfully', 'yith-woocommerce-wishlist' ) ) )
399
+ ),
400
+ 'actions' => array(
401
+ 'add_to_wishlist_action' => 'add_to_wishlist',
402
+ 'remove_from_wishlist_action' => 'remove_from_wishlist',
403
+ 'reload_wishlist_and_adding_elem_action' => 'reload_wishlist_and_adding_elem',
404
+ 'load_mobile_action' => 'load_mobile',
405
+ 'delete_item_action' => 'delete_item',
406
+ 'save_title_action' => 'save_title',
407
+ 'save_privacy_action' => 'save_privacy',
408
+ 'load_fragments' => 'load_fragments'
409
+ )
410
+ ) );
411
}
412
413
/**
428
429
/* === TEMPLATES === */
430
431
+ /**
432
+ * Include main wishlist template
433
+ *
434
+ * @var $var array Array of parameters for current view
435
+ * @return void
436
+ */
437
public function main_wishlist_content( $var ) {
438
+ $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
439
+ $layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
440
441
yith_wcwl_get_template_part( $template, '', $layout, $var );
442
+ }
443
+
444
+ /**
445
+ * Include wishlist header template
446
+ *
447
+ * @var $var array Array of parameters for current view
448
+ * @return void
449
+ */
450
public function wishlist_header( $var ) {
451
+ $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
452
$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
453
454
+ yith_wcwl_get_template_part( $template, 'header', $layout, $var );
455
+ }
456
457
+ /**
458
+ * Include wishlist footer template
459
+ *
460
+ * @var $var array Array of parameters for current view
461
+ * @return void
462
+ */
463
public function wishlist_footer( $var ) {
464
$template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';
465
$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';
466
467
yith_wcwl_get_template_part( $template, 'footer', $layout, $var );
468
+ }
469
470
+ /* === TEMPLATE MODIFICATIONS === */
471
472
/**
473
* Add class to products when Add to Wishlist is shown on loop
500
501
/* === UTILS === */
502
503
+ /**
504
+ * Format options that will sent through AJAX calls to refresh arguments
505
+ *
506
+ * @param $options array Array of options
507
+ * @param $context string Widget/Shortcode that will use the options
508
+ * @return array Array of formatted options
509
+ * @since 3.0.0
510
+ */
511
public function format_fragment_options( $options, $context = '' ) {
512
+ // removes unusable values, and changes options common for all fragments
513
+ if( ! empty( $options ) ){
514
+ foreach( $options as $id => $value ){
515
+ if( is_object( $value ) || is_array( $value ) ){
516
+ // remove item if type is not supported
517
+ unset( $options[ $id ] );
518
+ }
519
+ elseif( 'ajax_loading' == $id ){
520
+ $options['ajax_loading'] = false;
521
+ }
522
+ }
523
+ }
524
525
+ // applies context specific changes
526
+ if( ! empty( $context ) ){
527
+ $options['item'] = $context;
528
+
529
+ switch( $context ) {
530
+ case 'add_to_wishlist':
531
+ unset( $options['template_part'] );
532
+ unset( $options['label'] );
533
+ unset( $options['exists'] );
534
+ unset( $options['icon'] );
535
+ unset( $options['link_classes'] );
536
+ unset( $options['link_popup_classes'] );
537
+ unset( $options['container_classes'] );
538
+ unset( $options['found_in_list'] );
539
+ unset( $options['found_item'] );
540
+ unset( $options['popup_title'] );
541
+ break;
542
+ }
543
+ }
544
545
+ return $options;
546
+ }
547
548
+ /**
549
+ * Decode options that comes from the fragment
550
+ *
551
+ * @param $options array Options for the fragments
552
+ * @return array Filtered options for the fragment
553
+ */
554
public function decode_fragment_options( $options ) {
555
+ if( ! empty( $options ) ){
556
+ foreach( $options as $id => $value ){
557
+ if( 'true' == $value ){
558
+ $options[ $id ] = true;
559
+ }
560
+ elseif( 'false' == $value ){
561
+ $options[ $id ] = false;
562
+ }
563
+ }
564
+ }
565
566
+ return $options;
567
+ }
568
569
/**
570
* Alter add to cart button when on wishlist page
571
+ *
572
+ * @return void
573
+ * @since 2.0.0
574
+ * @version 3.0.0
575
*/
576
public function alter_add_to_cart_button(){
577
+ add_filter( 'woocommerce_loop_add_to_cart_args', array( $this, 'alter_add_to_cart_args' ) );
578
+ add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'alter_add_to_cart_text' ), 10, 2 );
579
+ add_filter( 'woocommerce_product_add_to_cart_url', array( $this, 'alter_add_to_cart_url' ), 10, 2 );
580
}
581
582
/**
583
+ * Restore default Add to Cart button, after wishlist handling
584
+ *
585
+ * @return void
586
+ * @since 3.0.0
587
*/
588
public function restore_add_to_cart_button() {
589
remove_filter( 'woocommerce_loop_add_to_cart_args', array( $this, 'alter_add_to_cart_args' ) );
594
/**
595
* Changes arguments used to print Add to Cart button on wishlist (classes and attributes)
596
*
597
+ * @param $args array Array of arguments
598
+ * @return array Array of filtered arguments
599
+ * @since 3.0.0
600
*/
601
public function alter_add_to_cart_args( $args ) {
602
$use_custom_button = get_option( 'yith_wcwl_add_to_cart_style' );
603
$button_class = in_array( $use_custom_button, array( 'button_custom', 'button_default' ) );
604
$icon = get_option( 'yith_wcwl_add_to_cart_icon' );
605
$custom_icon = get_option( 'yith_wcwl_add_to_cart_custom_icon' );
606
+ $classes = isset( $args['class'] ) ? explode( ' ', $args['class'] ) : array();
607
608
+ if( ! $button_class && $pos = array_search( 'button', $classes ) !== false ){
609
+ unset( $classes[ $pos ] );
610
+ }
611
+ elseif( $button_class ){
612
+ $classes[] = 'button';
613
+ }
614
615
+ $classes[] = 'add_to_cart';
616
+ $classes[] = 'alt';
617
618
+ $args['class'] = implode( ' ', $classes );
619
620
if( 'button_custom' == $use_custom_button && $icon != 'none' ) {
621
if( ! isset( $args['attributes'] ) ){
622
$args['attributes'] = array();
623
+ }
624
625
if( $icon != 'custom' ) {
626
$args['attributes']['data-icon'] = $icon;
627
}
628
elseif( $custom_icon ){
629
$args['attributes']['data-icon'] = $custom_icon;
630
+ }
631
}
632
633
+ return $args;
634
}
635
636
/**
637
+ * Filter Add to Cart button label on wishlist page
638
+ *
639
+ * @param $text string Button label
640
+ * @param \WC_Product Current product
641
+ * @return string Filtered label
642
*/
643
public function alter_add_to_cart_text( $text, $product ) {
644
$label_option = get_option( 'yith_wcwl_add_to_cart_text', __( 'Add to cart', 'yith-woocommerce-wishlist' ) );
648
}
649
650
/**
651
+ * Filter Add to Cart button url on wishlist page
652
+ *
653
+ * @param $url string Url to the Add to Cart
654
+ * @param $product \WC_Product Current product
655
+ * @return string Filtered url
656
*/
657
public function alter_add_to_cart_url( $url, $product ) {
658
+ global $yith_wcwl_wishlist_token;
659
+
660
+ if( $yith_wcwl_wishlist_token ){
661
+ $wishlist = yith_wcwl_get_wishlist( $yith_wcwl_wishlist_token );
662
+
663
+ if( ! $wishlist ){
664
+ return $url;
665
+ }
666
+
667
+ $wishlist_id = $wishlist->get_id();
668
+ $item = $wishlist->get_product( $product->get_id() );
669
+
670
+ if( wp_doing_ajax() ){
671
+ $url = add_query_arg( 'add-to-cart', $product->get_id(), YITH_WCWL()->get_wishlist_url( 'view/' . $yith_wcwl_wishlist_token ) );
672
+ }
673
+
674
+ if( $product->is_type( array( 'simple', 'variation' ) ) && get_option( 'yith_wcwl_redirect_cart' ) == 'yes' ){
675
+ $url = add_query_arg( 'add-to-cart', $product->get_id(), wc_get_cart_url() );
676
+ }
677
+
678
+ if( ! $product->is_type( 'external' ) && get_option( 'yith_wcwl_remove_after_add_to_cart' ) == 'yes' ){
679
+ $url = add_query_arg(
680
+ array(
681
+ 'remove_from_wishlist_after_add_to_cart' => $product->get_id(),
682
+ 'wishlist_id' => $wishlist_id,
683
+ 'wishlist_token' => $yith_wcwl_wishlist_token
684
+ ),
685
+ $url
686
+ );
687
+ }
688
+
689
+ if( $item && 'yes' == get_option( 'yith_wcwl_quantity_show' ) ){
690
+