Exemple #1
0
 /// <summary>
 /// Changes the current currency of the customer's session. The currency is also changed for the customer's current order if present. If you try to set the current currency to a currency that is not allowed in the current payment country, nothing will happen.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="currencyId">Id of the currency to change to.</param>
 /// <returns>The current currency.</returns>
 public static Currency SetCurrentCurrency(long storeId, long currencyId)
 {
     return(TeaCommerceHelper.SetCurrentCurrency(storeId, currencyId));
 }
Exemple #2
0
 /// <summary>
 /// Returns the value of a property on the product. Will traverse the content tree recursively to find the value. Will also use the master relation property of the product to search master products. NOTE: If you have a DynamicNode model use that instead of the string productIdentifier, which is slightly slower.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="productIdentifier">A unique identifier of the product. E.g. the node id from Umbraco.</param>
 /// <param name="propertyAlias">Alias of the property to find.</param>
 /// <returns>The text value of the property.</returns>
 public static string GetPropertyValue(long storeId, string productIdentifier, string propertyAlias)
 {
     return(TeaCommerceHelper.GetPropertyValue(storeId, productIdentifier, propertyAlias));
 }
Exemple #3
0
 /// <summary>
 /// Gets a specific order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="orderId">Unique id of the order.</param>
 /// <returns>An order object.</returns>
 public static Order GetOrder(long storeId, Guid orderId)
 {
     return(TeaCommerceHelper.GetOrder(storeId, orderId));
 }
Exemple #4
0
 /// <summary>
 /// Format a decimal to a price using the current currency.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="price">The price to format excl. VAT.</param>
 /// <returns>A price object.</returns>
 public static Price FormatPrice(long storeId, decimal price)
 {
     return(TeaCommerceHelper.FormatPrice(storeId, price));
 }
Exemple #5
0
 /// <summary>
 /// Removes the customers current order from session. The order will not be deleted.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>The removed order object.</returns>
 public static Order RemoveCurrentOrder(long storeId)
 {
     return(TeaCommerceHelper.RemoveCurrentOrder(storeId));
 }
Exemple #6
0
 /// <summary>
 /// Get the price for a specific payment method using the current currency.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="paymentMethodId">Id of the payment method.</param>
 /// <returns>A price object.</returns>
 public static Price GetPriceForPaymentMethod(long storeId, long paymentMethodId)
 {
     return(TeaCommerceHelper.GetPriceForPaymentMethod(storeId, paymentMethodId));
 }
Exemple #7
0
 /// <summary>
 /// Remove a discount code from the customer's current order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="code">The discount code.</param>
 /// <returns>The removed discount code.</returns>
 public static AppliedDiscountCode RemoveDiscountCode(long storeId, string code)
 {
     return(TeaCommerceHelper.RemoveDiscountCode(storeId, code));
 }
Exemple #8
0
 /// <summary>
 /// Gets the country regions for a specific store. Specify a <paramref name="countryId"/> to only get country regions for this country.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="countryId">Id of the country.</param>
 /// <returns>A collection of country region objects.</returns>
 public static IEnumerable <CountryRegion> GetCountryRegions(long storeId, long?countryId = null)
 {
     return(TeaCommerceHelper.GetCountryRegions(storeId, countryId));
 }
Exemple #9
0
 /// <summary>
 /// Gets the current payment country region of the customer's session. If the customer has a current order the payment country region of that order is returned.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>The current payment country region object.</returns>
 public static CountryRegion GetCurrentPaymentCountryRegion(long storeId)
 {
     return(TeaCommerceHelper.GetCurrentPaymentCountryRegion(storeId));
 }
Exemple #10
0
 /// <summary>
 /// Changes the current payment country of the customer's session. The payment country is also changed for the customer's current order if present. If the country is changed and the current currency isn't allowed in this country - then the currency will change to the default currency of the new payment country. It is the same with the current shipping method and payment method.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="countryId">Id of the country to change to.</param>
 /// <returns>The new current payment country object.</returns>
 public static Country SetCurrentPaymentCountry(long storeId, long countryId)
 {
     return(TeaCommerceHelper.SetCurrentPaymentCountry(storeId, countryId));
 }
Exemple #11
0
 /// <summary>
 /// Gets a country region from a specfic store.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="countryRegionId">The country region id.</param>
 /// <returns>A country region object.</returns>
 public static CountryRegion GetCountryRegion(long storeId, long countryRegionId)
 {
     return(TeaCommerceHelper.GetCountryRegion(storeId, countryRegionId));
 }
Exemple #12
0
 /// <summary>
 /// Gets the current shipping country of the customer's session. If the customer has a current order the shipping country of that order is returned.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>The current shipping country object.</returns>
 public static Country GetCurrentShippingCountry(long storeId)
 {
     return(TeaCommerceHelper.GetCurrentShippingCountry(storeId));
 }
Exemple #13
0
 /// <summary>
 /// Gets the countries for a specific store.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>A collection of country objects.</returns>
 public static IEnumerable <Country> GetCountries(long storeId)
 {
     return(TeaCommerceHelper.GetCountries(storeId));
 }
Exemple #14
0
 /// <summary>
 /// Gets a country from a specfic store.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="countryId">The country id.</param>
 /// <returns>A country object.</returns>
 public static Country GetCountry(long storeId, long countryId)
 {
     return(TeaCommerceHelper.GetCountry(storeId, countryId));
 }
Exemple #15
0
 /// <summary>
 /// Changes the current payment method of the customer's session. The payment method is also changed for the customer's current order if present.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="paymentMethodId">Id of the payment method.</param>
 /// <returns>The new current payment method object.</returns>
 public static PaymentMethod SetCurrentPaymentMethod(long storeId, long?paymentMethodId)
 {
     return(TeaCommerceHelper.SetCurrentPaymentMethod(storeId, paymentMethodId));
 }
Exemple #16
0
 /// <summary>
 /// Changes the current shipping country region of the customer's session. The shipping country region is also changed for the customer's current order if present. If the country region is changed and the current shipping method isn't allowed in this country region - then the shipping method will change to the default shipping method of the new shipping country region. If no current shipping country region is specified it will fallback to use the shipping country and then payment country.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="countryRegionId">Id of the country region to change to.</param>
 /// <returns>The new current shipping country region object.</returns>
 public static CountryRegion SetCurrentShippingCountryRegion(long storeId, long?countryRegionId)
 {
     return(TeaCommerceHelper.SetCurrentShippingCountryRegion(storeId, countryRegionId));
 }
Exemple #17
0
 /// <summary>
 /// Sets the customers current order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="orderId">Unique id of the order.</param>
 /// <returns>The new current order object.</returns>
 public static Order SetCurrentOrder(long storeId, Guid orderId)
 {
     return(TeaCommerceHelper.SetCurrentOrder(storeId, orderId));
 }
Exemple #18
0
 /// <summary>
 /// Gets the customers current order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="autoCreate">If <c>true</c> - creates a new order if no current order is present in the session.</param>
 /// <returns>An order object.</returns>
 public static Order GetCurrentOrder(long storeId, bool autoCreate = true)
 {
     return(TeaCommerceHelper.GetCurrentOrder(storeId, autoCreate));
 }
Exemple #19
0
 /// <summary>
 /// Generates and returns the full html for the form to post when going to payment. Will use the current payment method's payment provider.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="submitInput">A html button/input that should be outputted with the form. Will make it possible to use whatever button needed in the setup.</param>
 /// <returns>A html form.</returns>
 public static string GeneratePaymentForm(long storeId, string submitInput)
 {
     return(TeaCommerceHelper.GeneratePaymentForm(storeId, submitInput));
 }
Exemple #20
0
 /// <summary>
 /// Gets the current shipping method of the customer's session. If the customer has a current order the shipping method of that order is returned.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>The current shipping method object.</returns>
 public static ShippingMethod GetCurrentShippingMethod(long storeId)
 {
     return(TeaCommerceHelper.GetCurrentShippingMethod(storeId));
 }
Exemple #21
0
 /// <summary>
 /// Remove a gift card from the customer's current order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="code">The gift card code.</param>
 /// <returns>The removed gift card.</returns>
 public static AppliedGiftCard RemoveGiftCard(long storeId, string code)
 {
     return(TeaCommerceHelper.RemoveGiftCard(storeId, code));
 }
Exemple #22
0
 /// <summary>
 /// Changes the current shipping method of the customer's session. The shipping method is also changed for the customer's current order if present.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="shippingMethodId">Id of the shipping method.</param>
 /// <returns>The new current shipping method object.</returns>
 public static ShippingMethod SetCurrentShippingMethod(long storeId, long?shippingMethodId)
 {
     return(TeaCommerceHelper.SetCurrentShippingMethod(storeId, shippingMethodId));
 }
Exemple #23
0
 /// <summary>
 /// Gets a price for a specific product in the current currency.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="productIdentifier">A unique identifier of the product. E.g. the node id from Umbraco.</param>
 /// <returns>A price object.</returns>
 public static Price GetPrice(long storeId, string productIdentifier)
 {
     return(TeaCommerceHelper.GetPrice(storeId, productIdentifier));
 }
Exemple #24
0
 /// <summary>
 /// Get the price for a specific shipping method using the current currency.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="shippingMethodId">Id of the shipping method.</param>
 /// <returns>A price object.</returns>
 public static Price GetPriceForShippingMethod(long storeId, long shippingMethodId)
 {
     return(TeaCommerceHelper.GetPriceForShippingMethod(storeId, shippingMethodId));
 }
Exemple #25
0
 /// <summary>
 /// Gets the current stock for a specific product.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="productIdentifier">A unique identifier of the product. E.g. the node id from Umbraco.</param>
 /// <returns>The stock of the product. Will be null if no stock have been provided for this product.</returns>
 public static decimal?GetStock(long storeId, string productIdentifier)
 {
     return(TeaCommerceHelper.GetStock(storeId, productIdentifier));
 }
Exemple #26
0
 /// <summary>
 /// Gets a collection of all payment methods that are allowed in the current payment country and payment country region.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="onlyAllowed">If <c>true</c> - only payment methods allowed in the current session state will be returned.</param>
 /// <returns>A collection of payment methods objects.</returns>
 public static IEnumerable <PaymentMethod> GetPaymentMethods(long storeId, bool onlyAllowed = true)
 {
     return(TeaCommerceHelper.GetPaymentMethods(storeId, onlyAllowed));
 }
Exemple #27
0
 /// <summary>
 /// Gets the customers current finalized order.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>An order object.</returns>
 public static Order GetCurrentFinalizedOrder(long storeId)
 {
     return(TeaCommerceHelper.GetCurrentFinalizedOrder(storeId));
 }
Exemple #28
0
 /// <summary>
 /// Gets the current payment method of the customer's session. If the customer has a current order the payment method of that order is returned.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>The current payment method object.</returns>
 public static PaymentMethod GetCurrentPaymentMethod(long storeId)
 {
     return(TeaCommerceHelper.GetCurrentPaymentMethod(storeId));
 }
Exemple #29
0
 /// <summary>
 /// Gets a collection of orders.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <param name="orderIds">A collection of unique order id's.</param>
 /// <returns>A collection of orders.</returns>
 public static IEnumerable <Order> GetOrders(long storeId, IEnumerable <Guid> orderIds)
 {
     return(TeaCommerceHelper.GetOrders(storeId, orderIds));
 }
Exemple #30
0
 /// <summary>
 /// Gets a specific store.
 /// </summary>
 /// <param name="storeId">Id of the store.</param>
 /// <returns>A store object.</returns>
 public static Store GetStore(long storeId)
 {
     return(TeaCommerceHelper.GetStore(storeId));
 }