Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.