1

Assuming you're getting product_id from ajax call then I think there is a minor problem in your jquery. It should be $(".product-id-"+wislistAddedProductId).addClass('in-wishlist') not $(".product-id"+wislistAddedProductId).addClass('in-wishlist'). Check your div class name. Try below : <script> require(['jquery'], function($){ ...


1

as discussed, i see that a few corrections are needed: you should call the 'test_testmodule/index/test' url as you defined your frontName as 'test_testmodule' you should use the 'standard' routerId if you are working on the frontend side with this call you are expecting a JSON formatted response as per your AJAX call definition, so you will have to format ...


1

Using a custom controller to change Wishlist button(icon) color once the product added to Wishlist. app/code/vendor/module/Controller/Index/Wishlist.php <?php namespace Vendor\Module\Controller\Index; class Wishlist extends \Magento\Framework\App\Action\Action { public function __construct( \Magento\Framework\App\Action\Context $context, ...


Only top voted, non community-wiki answers of a minimum length are eligible