R
R
Rasul Gudantov2018-08-21 16:24:14
JavaScript
Rasul Gudantov, 2018-08-21 16:24:14

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

1 answer(s)
Z
zoozag, 2018-08-23
@zoozag

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 question

Ask a Question

731 491 924 answers to any question