Answer the question
In order to leave comments, you need to log in
How to make Ajax loading of categories and products from them on OpenCart 2.1?
Hello!
The problem is that I can’t understand the logic of displaying categories, and then products using ajax. So that when you click on the category menu, all products from this category exit.
Can you point me in which direction to look?
Answer the question
In order to leave comments, you need to log in
You make a request for the category url and replace the block with the content on the page with the content block from the response.
The jquery .load() method solves everything in 1 line of code.
$( "#container" ).load( "{category url} #content" );
Replace only selectors with your own
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question