Question

Using OpenCart how would I show a categories products as content loaded via AJAX from a MySQL database? This content would be then shown inside a <div>

Was it helpful?

Solution

Fire up MooTools or jQuery and use their AJAX support. Put an onclick handler on each category link, which calls a function that fetches the category data from the server. It can be raw html, which you then replace the contents of that with.

The server-side script would generate JUST the html necessary to display the product info. Since you'll be inserting it into a div inside an existent page, there's no need for headers/footers, just the core product data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top