Knetik.Cart.Deserialize C# (CSharp) Method

Deserialize() public method

public Deserialize ( KnetikSimpleJSON.KnetikJSONNode json ) : void
json KnetikSimpleJSON.KnetikJSONNode
return void
        public override void Deserialize(KnetikJSONNode json)
        {
            base.Deserialize (json);

            var cartJson = json["cart"];
            SubTotal = cartJson["sub_total"].AsDouble;
            DiscountTotal = cartJson["discount_total"].AsDouble;
            GrandTotal = cartJson["grand_total"].AsDouble;
            Tax = cartJson["tax"].AsDouble;
            Status = cartJson["status"].Value;

            Items.Clear();
            foreach (var node in json["items"].Children) {
                var item = new CartItem(Client, this);
                item.Deserialize(node);
                Items.Add(item);
            }
        }