Skip to content

Instantly share code, notes, and snippets.

@janlowgren
Created November 26, 2019 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janlowgren/be782d5a7b094bcad5853225c2b46770 to your computer and use it in GitHub Desktop.
Save janlowgren/be782d5a7b094bcad5853225c2b46770 to your computer and use it in GitHub Desktop.
Cart sublayout that loads an MVC powered cart item
<%@ Control Language="c#" AutoEventWireup="true" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Panel runat="server" ID="pnlMvcShoppingCart" ClientIDMode="Static">
<div class="loader loader-bar" style="margin: 200px 0"></div>
</asp:Panel>
<script src="/ui/trede/js/libs/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
(function () {
$("#pnlMvcShoppingCart").load("/<%=Sitecore.Context.Language.Name%>/Commerce/Pages/Cart%20Page?ajax=true", function (response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#pnlMvcCheckout").html(msg + xhr.status + " " + xhr.statusText);
}
});
})();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment