cancel
Showing results for 
Search instead for 
Did you mean: 

Simple block loading javascript.

0 Kudos

Simple block loading javascript.

Feature request from paales, posted on GitHub Jun 28, 2014

Related to #322 and #82.

The idea is that it should be possible to load a certain block (cart, toplinks, wishlist block) without creating a controller, with a nice Javascript API that is scalable for frontend developers.

As @kandy metioned, it is already possible to load certain blocks (although, that seems to have been build for the pagecache, not partial reloads), but I couldn't find a proper JS library to achieve this.

This issue focusses on the JS API.

We have created such a solution for our own needs: https://github.com/ho-nl/Ho_AjaxCart

In short, We have an action source:

<a href="#" data-ho-ajax-link="cart">foo</a>

And have target:

<div data-ho-ajax="<?php echo $this->getNameInLayout(); ?>" data-ho-ajax-group="cart">
   ...
</div>

When the action is called, the target is reloaded without reloading the complete page.

This solution works well for us, allows us to create fully ajax-reloaded pages. For example: The cart page allows you to clear an item from your cart an it reloads the products table, totals, shipping costs and the cart header. When someone estimates their shipping the shipping block is reloaded and the totals, but the products table.

Something like this would be really handy if it were in the core and would greatly improve compatibility with modules.

5 Comments
apiuser
New Member
Status changed to: Investigating
 
apiuser
New Member

Comment from kandy, posted on GitHub Jun 28, 2014

Magento 2 already have one to show private content (see: \Magento\PageCache\Controller\Block::renderAction)

apiuser
New Member

Comment from ilol, posted on GitHub Jul 03, 2014

@paales, thank you. We will investigate this. I will keep you informed. @kandy, thanks also.

apiuser
New Member

Comment from vpelipenko, posted on GitHub Jan 29, 2015

Internal ticket: MAGETWO-25908

sn_heukels
Regular Visitor

@vpelipenko

 

Any news on this? or has it become obsolete?