Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.1 KB
Raw Blame
@model WishlistModel
@*
    Data island for the wishlist view-model. The behaviour lives in
    vueapp/src/views/wishlist.js, which publishes the global `vmwishlist`.
*@
@{
    var addToCartUrl = Model.EmailWishlistEnabled && !Model.IsEditable
        ? Url.RouteUrl("AddItemToCartFromWishlist", new { customerGuid = Model.CustomerGuid }) + "&shoppingcartId="
        : Url.RouteUrl("AddItemToCartFromWishlist") + "?shoppingcartId=";

    var payload = new {
        model = Model,
        routes = new {
            deleteItem = Url.RouteUrl("DeleteItemFromWishlist"),
            addToCart = addToCartUrl,
            getItemCart = Url.RouteUrl("GetItemCart"),
            updateQuantity = Url.RouteUrl("UpdateQuantityWishlist"),
            wishlist = Url.RouteUrl("Wishlist"),
            sidebarShoppingCart = Url.RouteUrl("SidebarShoppingCart")
        },
        res = new {
            warning = Loc["common.warning"].ToString(),
            success = Loc["common.success"].ToString(),
            addedToCart = Loc["Wishlist.AddedToCart"].ToString()
        }
    };
}
<script type="application/json" data-grand-vm="wishlist">@Json.Serialize(payload)</script>