Load minicart via ajax call

ThemeBurn SupportForumsOpenCart ThemesPavilion OpenCart ThemeLoad minicart via ajax call

This topic has been marked as resolved.

Hello support,

due to cache and performance reasons we would like to load the minicart via ajax call async. Works well, if we use the route common/cart/info for the call.

The only thing not working is the dropdown menu for the minicart. AFAIK, the dynamic menus are loaded in the js file libs.min.js.

Do you know the best approach to reload/reactivate the dropdown menu after the ajax call?

Thanks,
Alex

 axanne
July 30, 2018 at 11:11 pm #65001

Ok, found it myself. After the cart has been loaded, you need to execute dropdown_menu('.nav:not(.nav-stacked):not(.nav-tabs)' , '> li', 'below', 100);

It would be great, if TB could publish some more documentation about BurnEngine or refer to other docs, if BE used other tech stacks for modification. It is by far the best theme engine and page builder for OC and it would be great to extend this engine with custom mods!

 axanne
July 31, 2018 at 11:36 am #65004

Hi,

Sorry for not being able to help earlier. Glad to see you have found a solution!

Wound’t be better if you insert only the new content inside the cart and not replace the entire cart? You will save a JS menu initialization this way.

Thanks for the suggestion about the documentation – we will try to improve it!

BR,
ThemeBurn team

August 1, 2018 at 10:26 am #65016

Yes, probably more efficient to just update the menu content and the item counter, but that would require a custom modification of the minicart function, which might need modification in future versions.

That way it was easier and quicker and served our needs for having an updated cart for html-cached pages via Varnish.

Thanks for getting back to me.

 axanne
August 2, 2018 at 1:56 pm #65031

Resolved.

August 6, 2018 at 12:34 pm #65061
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.