Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #140 from EmicoEcommerce/issue/ajax-filtering-add-…
Browse files Browse the repository at this point in the history
…to-cart-category

Issue/ajax filtering add to cart category
  • Loading branch information
edwinljacobs authored Jan 15, 2021
2 parents abdcc7c + 18a0345 commit f841f23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions view/frontend/layout/tweakwise_ajax_category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<update handle="empty"/>
<update handle="formkey"/>
<container name="root">
<container name="content"/>
<container name="sidebar.main"/>
Expand Down
1 change: 1 addition & 0 deletions view/frontend/layout/tweakwise_ajax_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<update handle="empty"/>
<update handle="formkey"/>
<container name="root">
<container name="content"/>
<container name="sidebar.main"/>
Expand Down
9 changes: 8 additions & 1 deletion view/frontend/web/js/navigation-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,16 @@ define([
.replaceWith(newToolbarFirst.outerHTML);
}
if (newToolbarLast) {
var scripts = '';
$(newToolbarLast).siblings('script[type="text/x-magento-init"]').map(
function (index, element) {
scripts += element.outerHTML;
}
);

toolbar
.last()
.replaceWith(newToolbarLast.outerHTML);
.replaceWith(newToolbarLast.outerHTML + scripts);
}

$('body').trigger('contentUpdated');
Expand Down

0 comments on commit f841f23

Please sign in to comment.