0

I am creating a functionality on my custom phtml.

I want simple ajax call on my controller and get product grid in response.

to ajax call I used this:

require(['jquery'], function($){ 
    $.ajax({
        url: "/mymodule", 
        success: function(result){
            $("#div1").html(result);
        }
    });
});

How can i get product collection and assign it to Magento_Catalog::product/list.phtml file and in return send products collection in grid.

  • first check your ajax calling controller by putting echo in controller. – Pawan Feb 9 at 18:34
  • Yes I checked, I am getting response from controller, need product grid in response – Atif Ameer Feb 9 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.