Posted on

Magento 2 – How does the remove wishlist button work?

I am wondering how does the remove wishlist button work?

i have checked the code, and there is no form tag around it.

How can it post to the remove item controller in
vendor/magento/module-wishlist/Controller/Index/Remove.php

<div class=”actions-secondary”>
<a href=”#” data-bind=”attr: {‘data-post’: delete_item_params}” title=”Remove This Item” class=”btn-remove action delete” data-post=”{&quot;action&quot;:&quot;http://m226.test/wishlist/index/remove/&quot;,&quot;data&quot;:{&quot;item&quot;:&quot;2&quot;,&quot;uenc&quot;:&quot;aHR0cDovL20yMjYudGVzdC93aXNobGlzdC9pbmRleC9pbmRleC93aXNobGlzdF9pZC8xLw,,&quot;}}”>
<span>Remove This Item</span>
</a>
</div>

Leave a Reply

Your email address will not be published. Required fields are marked *