user2884000
user2884000

Reputation: 1

Is it possible to include cart on webpage outside Opencart directory?

My client wants the mini cart in header to show on all pages, even those not included in shop. Have Opencart installed in subfolder... www.mypage.com/shop

Rest of webpage is in www.mypage.com/index.php and so on....

Can it be done, and does someone have a solution to post?

Any help appreciated!

Upvotes: 0

Views: 202

Answers (1)

Adam Nicholson
Adam Nicholson

Reputation: 320

The easiest way would be to do an AJAX call to the module/cart controller, which will display the same output returned to the default theme header http://demo.opencart.com/

$.get("http://website.com/shop/index.php?route=module/cart", function(html) {
    // do something with the `html` variable
});

Upvotes: 1

Related Questions