Class Basket
Contains information about a basket before it is converted into an Order.
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Basket : IEntity, IRescopeEntity, IBasketOrSubscription
- Inheritance
-
Basket
- Implements
- Inherited Members
Remarks
Baskets are created by the @"Rescope.Commerce.Core.Services.BasketService?displayProperty=name" when a user is browsing your store. Baskets hold information such as shipping/billing address, selected country/currency and the selected shipping method. Once these values are populated, a basket can be converted into an Order using @"Rescope.Commerce.Core.Services.BasketService.InitiatePayment*?displayProperty=nameWithType".
Properties
AdditionalData
public Dictionary<string, string> AdditionalData { get; set; }
Property Value
BasketLineItems
[NotMapped]
public IEnumerable<BasketLineItem> BasketLineItems { get; }
Property Value
BasketSecret
[MaxLength(64)]
[JsonIgnore]
[JsonIgnore]
public string? BasketSecret { get; set; }
Property Value
BillingAddress
public PostalAddress? BillingAddress { get; set; }
Property Value
CancelUrl
public string? CancelUrl { get; set; }
Property Value
ConfirmUrl
public string? ConfirmUrl { get; set; }
Property Value
CreatedAt
public DateTime CreatedAt { get; set; }
Property Value
Currency
public Currency Currency { get; }
Property Value
CurrencyId
public Guid CurrencyId { get; }
Property Value
CustomData
public string? CustomData { get; set; }
Property Value
DeliveryAddress
public PostalAddress? DeliveryAddress { get; set; }
Property Value
public string? Email { get; set; }
Property Value
Errors
[NotMapped]
public IEnumerable<BasketError> Errors { get; }
Property Value
Id
public Guid Id { get; }
Property Value
OrderNumber
public string? OrderNumber { get; }
Property Value
PaymentMethod
public PaymentMethod? PaymentMethod { get; set; }
Property Value
PaymentMethodId
public Guid? PaymentMethodId { get; set; }
Property Value
- Guid?
PaymentStatus
public PaymentStatus PaymentStatus { get; set; }
Property Value
Phone
public string? Phone { get; set; }
Property Value
ShippingMethod
public ShippingMethod? ShippingMethod { get; set; }
Property Value
ShippingMethodId
public Guid? ShippingMethodId { get; set; }
Property Value
- Guid?
ShippingPrice
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal ShippingPrice { get; }
Property Value
ShippingPriceFormatted
public string ShippingPriceFormatted { get; }
Property Value
ShippingTax
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal ShippingTax { get; }
Property Value
ShippingTaxFormatted
public string ShippingTaxFormatted { get; }
Property Value
Store
public Store Store { get; }
Property Value
StoreId
public Guid StoreId { get; }
Property Value
TotalLineItemsTax
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal TotalLineItemsTax { get; }
Property Value
TotalLineItemsTaxFormatted
public string TotalLineItemsTaxFormatted { get; }
Property Value
TotalPrice
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal TotalPrice { get; }
Property Value
TotalPriceFormatted
public string TotalPriceFormatted { get; }
Property Value
TotalShippingPrice
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal TotalShippingPrice { get; }
Property Value
TotalShippingPriceFormatted
public string TotalShippingPriceFormatted { get; }
Property Value
TotalTax
[Column(TypeName = "DECIMAL(19, 4)")]
public decimal TotalTax { get; }
Property Value
TotalTaxFormatted
public string TotalTaxFormatted { get; }
Property Value
UmbracoMemberKey
public Guid? UmbracoMemberKey { get; set; }
Property Value
- Guid?
UpdatedAt
public DateTime? UpdatedAt { get; set; }
Property Value
Methods
AddProduct(IProductOrVariant, IStockService?, int, IDictionary<Guid, string>?)
public Task AddProduct(IProductOrVariant product, IStockService? stockService, int quantity = 1, IDictionary<Guid, string>? customisationFields = null)
Parameters
productIProductOrVariantstockServiceIStockServicequantityintcustomisationFieldsIDictionary<Guid, string>
Returns
FormatNumber(decimal)
Format a decimal using this baskets's selected currency
public string FormatNumber(decimal number)
Parameters
numberdecimal
Returns
GetProductLineItem(string?)
public BasketLineItem? GetProductLineItem(string? sku)
Parameters
skustring
Returns
GetProductQuantity(string?)
public int GetProductQuantity(string? sku)
Parameters
skustring
Returns
RemoveProduct(IProductOrVariant)
public Task RemoveProduct(IProductOrVariant product)
Parameters
productIProductOrVariant
Returns
RemoveProduct(string)
public Task RemoveProduct(string productSku)
Parameters
productSkustring
Returns
SetProductQuantity(IProductOrVariant, IStockService?, int, IDictionary<Guid, string>?)
public Task SetProductQuantity(IProductOrVariant product, IStockService? stockService, int quantity, IDictionary<Guid, string>? customisationFields = null)
Parameters
productIProductOrVariantstockServiceIStockServicequantityintcustomisationFieldsIDictionary<Guid, string>