Skip to content

Commit

Permalink
Add 'alg_wc_wl_can_toggle_unlogged' filter
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Feb 13, 2020
1 parent 7d8d881 commit cd1be86
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 33 deletions.
10 changes: 9 additions & 1 deletion assets/css/alg-wc-wish-list.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/css/alg-wc-wish-list.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions assets/js/alg-wc-wish-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This js is mainly responsible for adding / removing WooCommerce product items from Wish list through Ajax,
* and to show a notification to user when Ajax response is complete.
*
* @version 1.5.9
* @version 1.6.3
* @since 1.0.0
* @requires jQuery.js
*/
Expand Down Expand Up @@ -125,7 +125,13 @@ jQuery(function ($) {
if (!this_btn.hasClass('loading')) {
this_btn.addClass('loading');
jQuery.post(alg_wc_wl.ajaxurl, data, function (response) {
if (response.success) {
if (
response.success &&
(
response.data.action === 'removed' ||
response.data.action === 'added'
)
) {
if (btns_with_same_item_id.hasClass('remove')) {
btns_with_same_item_id.removeClass('remove');
btns_with_same_item_id.addClass('add');
Expand Down
Loading

0 comments on commit cd1be86

Please sign in to comment.