BUG Easystore Wishlist - Question | JoomShaper

is live, now with multi-currency selling.

BUG Easystore Wishlist

Stephane Hanrez

Stephane Hanrez

EasyStore 2 weeks ago

Hello,

Sorry, found one more bug on Easystore, and this one is pretty annoying as I couldn't directly find an easy workaround (apart from modifying Easystore code, which I want to avoid).

Adding a product to the wishlist works fine, but when going to the wishlist itself, the add-on still displays the button as “Add to wishlist” and clicking it does not remove the product from the wishlist as expected.

In wishlist.site.js, the addToWishList() method determines whether the action should be add or remove based on whether the button has the .active class. On the wishlist page, the button does not seem to receive the proper active state even though isWishlist is correctly set to true.

Example rendered button:

<button
    type="button"
    x-data="easyStoreWishlist"
    @click="addToWishList({
        productId: 31,
        hasText: true,
        hasIcon: false,
        isWishlist: true
    })"
    class="btn btn-outline-secondary easystore-btn-add-to-wishlist"
>
    <span class="easystore-btn-text">
        Add to wishlist
    </span>
</button>

It seems that when the addon is used with the wishlist source, EasyStore should automatically render the wishlist button in its active/remove state instead of relying only on the .active class detection.

Could you please check whether this is a bug in the SP Page Builder wishlist addon or in the addtowishlist.php layout / wishlist.site.js logic?

Ideally, when isWishlist is true:

  • the button should display “Remove from wishlist”;
  • the button should already be in the active state;
  • clicking it should call the remove action;
  • and the wishlist page should refresh after the item is removed.

Btw, it seems there is also some bug in the page refresh after clicking this button... It looks like it refreshes immediately, without leaving the JS enough time to execute its action, as the action is not synchronous.

Could you please correct that in next Easystore version.

Thanks a lot

0
3 Answers
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 2 weeks ago #232807

Hello,

We sincerely apologize for the inconvenience.

Currently, the only way to create a wishlist page is to create an SP Page Builder page and set the Product List addon’s source to Wishlist.

Since you have full control over the SP Page Builder layout, you can simply remove the Add to Wishlist button from the Product List addon. The button is not necessary on the wishlist listing, as the page is specifically displaying products that have already been added to the wishlist.

We appreciate you bringing this behavior to our attention and apologize again for any inconvenience caused.

Best regards

0
Stephane Hanrez
Stephane Hanrez
Accepted Answer
2 weeks ago #232808

How do I then remove a product from the wishlist ?

My understanding is that the "Add to Wishlist" button is a toggle. If added to a product which is already in wishlist, it should display "Remove from wishlist" instead, and the behaviour should be to remove the product from the user's wishlist, which is not the observed behaviour at the moment, thus my bug report.

The logic currently implemented in addtowishlist.php and wishlist.site.js seems to be off according to me, it tries to add to the wishlist, even if the product is already in it + the page gets refreshed even before the JS has the time to execute the change.

0
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 2 weeks ago #232809

Hello,

Thank you for the clarification, and you are absolutely correct regarding the expected behavior.

The Add to Wishlist button is intended to work as a toggle. When a product is already in the wishlist, it should change to “Remove from wishlist”, and clicking it should remove the product rather than attempting to add it again.

We apologize for the confusion caused by our previous response. The behavior you described is indeed not working as expected. The fact that the page refreshes before the asynchronous wishlist action has completed is also something that needs to be addressed.

We will forward these findings to our development team so they can review the addtowishlist.php and wishlist.site.js logic and make the necessary corrections in a future EasyStore update.

Thank you for providing such detailed information and helping us identify the issue.

Best regards

0