/// <summary>
 /// Packages the current basket instantiation into a collection of <see cref="IShipment"/> using the <see cref="PackagingStrategyBase"/> strategy
 /// </summary>
 /// <param name="basket">
 /// The basket.
 /// </param>
 /// <param name="destination">
 /// The destination.
 /// </param>
 /// <param name="strategy">
 /// The strategy.
 /// </param>
 /// <returns>
 /// A collection of <see cref="IShipment"/>
 /// </returns>
 public static IEnumerable <IShipment> PackageBasket(this IBasket basket, IAddress destination, PackagingStrategyBase strategy)
 {
     return(basket.PackageBasket(MerchelloContext.Current, destination, strategy));
 }
Example #2
0
 /// <summary>
 /// Packages the current basket instantiation into a collection of <see cref="IShipment"/> using the <see cref="PackagingStrategyBase"/> strategy
 /// </summary>
 /// <param name="basket">
 /// The basket.
 /// </param>
 /// <param name="destination">
 /// The destination.
 /// </param>
 /// <param name="strategy">
 /// The strategy.
 /// </param>
 /// <returns>
 /// A collection of <see cref="IShipment"/>
 /// </returns>
 public static IEnumerable<IShipment> PackageBasket(this IBasket basket, IAddress destination, PackagingStrategyBase strategy)
 {
     return basket.PackageBasket(MerchelloContext.Current, destination, strategy);
 }
 /// <summary>
 /// Packages a basket into one or more shipments.
 /// </summary>
 /// <param name="backoffice">
 /// The backoffice.
 /// </param>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 /// <param name="destination">
 /// The destination.
 /// </param>
 /// <param name="strategy">
 /// The strategy.
 /// </param>
 /// <returns>
 /// The collection of <see cref="IShipment"/>.
 /// </returns>
 internal static IEnumerable <IShipment> PackageBackoffice(this IBackoffice backoffice, IMerchelloContext merchelloContext, IAddress destination, PackagingStrategyBase strategy)
 {
     return(!backoffice.Items.Any() ? new List <IShipment>() : strategy.PackageShipments());
 }
Example #4
0
 /// <summary>
 /// Packages a basket into one or more shipments.
 /// </summary>
 /// <param name="basket">
 /// The basket.
 /// </param>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 /// <param name="destination">
 /// The destination.
 /// </param>
 /// <param name="strategy">
 /// The strategy.
 /// </param>
 /// <returns>
 /// The collection of <see cref="IShipment"/>.
 /// </returns>
 internal static IEnumerable<IShipment> PackageBasket(this IBasket basket, IMerchelloContext merchelloContext, IAddress destination, PackagingStrategyBase strategy)
 {
     return !basket.Items.Any() ? new List<IShipment>() : strategy.PackageShipments();
 }