/// <summary>
		/// Initializes a new instance of the <see cref="SearchController"/> class.
		/// </summary>
		/// <param name="marketing">The marketing.</param>
		/// <param name="priceListClient">The price list client.</param>
		/// <param name="storeClient">The store client.</param>
		/// <param name="catalogClient">The catalog client.</param>
        public SearchController(MarketingHelper marketing, PriceListClient priceListClient, StoreClient storeClient,
                                CatalogClient catalogClient)
        {
            _marketing = marketing;
            _priceListClient = priceListClient;
            _storeClient = storeClient;
            _catalogClient = catalogClient;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SearchController" /> class.
 /// </summary>
 /// <param name="marketing">The marketing.</param>
 /// <param name="priceListClient">The price list client.</param>
 /// <param name="storeClient">The store client.</param>
 /// <param name="catalogClient">The catalog client.</param>
 /// <param name="searchFilter">The search filter.</param>
 public SearchController(MarketingHelper marketing, PriceListClient priceListClient, StoreClient storeClient,
                         CatalogClient catalogClient, ISearchFilterService searchFilter)
 {
     _marketing = marketing;
     _priceListClient = priceListClient;
     _storeClient = storeClient;
     _catalogClient = catalogClient;
     _searchFilter = searchFilter;
 }
		public ShipmentViewModel(OrderClient client, IViewModelsFactory<ISplitShipmentViewModel> splitVmFactory, IViewModelsFactory<ILineItemAddViewModel> wizardLineItemVmFactory, IViewModelsFactory<ILineItemViewModel> lineItemVmFactory, OrderViewModel orderViewModel, Shipment shipmentItem, IOrderEntityFactory entityFactory, IRepositoryFactory<IPricelistRepository> repositoryFactory, PriceListClient priceListClient)
		{
			_orderClient = client;
			ParentViewModel = orderViewModel;
			_currentOrder = orderViewModel._innerModel;
			CurrentShipment = shipmentItem;
			_entityFactory = entityFactory;
			_repositoryFactory = repositoryFactory;
			_priceListClient = priceListClient;
			_lineItemVmFactory = lineItemVmFactory;
			_wizardLineItemVmFactory = wizardLineItemVmFactory;
			_splitVmFactory = splitVmFactory;

			CommonShipmentConfirmRequest = orderViewModel.CommonOrderCommandConfirmRequest;

			ReleaseShipmentCommand = new DelegateCommand(RaiseReleaseShipmentInteractionRequest, () => CurrentShipment.IsReleaseable(_currentOrder.InnerItem, client));
			CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipmentInteractionRequest, () => CurrentShipment.IsCompletable(_currentOrder.InnerItem, client));
			CancelShipmentCommand = new DelegateCommand(RaiseCancelShipmentInteractionRequest, () => CurrentShipment.IsCancellable(_currentOrder.InnerItem, client));
			AddLineItemCommand = new DelegateCommand(RaiseAddLineItemInteractionRequest, () => CurrentShipment.IsModifyable(_currentOrder.InnerItem));
			MoveLineItemCommand = new DelegateCommand<ShipmentItem>(RaiseMoveLineItemInteractionRequest, x => x != null && CurrentShipment.IsModifyable(_currentOrder.InnerItem));
			RemoveLineItemCommand = new DelegateCommand<ShipmentItem>(RaiseRemoveLineItemInteractionRequest, x => x != null && CurrentShipment.IsModifyable(_currentOrder.InnerItem));
			ViewLineItemDetailsCommand = new DelegateCommand<object>(RaiseViewLineItemDetailsInteractionRequest, x => x != null);
		}
        /// <summary>
        /// Populates the variation information.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="lineItem">The line item.</param>
	    private void PopulateVariationInfo(Item item, LineItem lineItem)
		{
			if (item == null)
			{
				return;
			}

			lineItem.MaxQuantity = item.MaxQuantity;
			lineItem.MinQuantity = item.MinQuantity;

			var priceListHelper = new PriceListClient(PricelistRepository, CustomerSessionService, PriceListEvaluator, PriceListEvalContext, CacheRepository);

			var itemPrice = priceListHelper.GetLowestPrice(item.ItemId, lineItem.Quantity);

			if (itemPrice == null)
			{
				RemoveLineItem(lineItem);
				return;
			}

			// Get old and new prices for comparison.
			var oldPrice = lineItem.ListPrice;

            // new logic is to have the price always be replaced
            var newPrice = itemPrice.Sale ?? itemPrice.List;

			newPrice = Math.Round(newPrice, 2); // Comparison. The LineItem.ListPrice property rounds values.

			// Get old and new currencies for comparison.
			var oldCurrencyCode = CurrentOrderGroup.BillingCurrency;
			var newCurrencyCode = CustomerSessionService.CustomerSession.Currency;
			if (string.IsNullOrEmpty(oldCurrencyCode))
			{
				oldCurrencyCode = newCurrencyCode;
			}

			// Check for price changes OR currency changes.
			if (oldPrice == newPrice && oldCurrencyCode == newCurrencyCode)
			{
				return;
			}

			// Set new price and currency vales on line item.
			lineItem.ListPrice = newPrice;
            lineItem.PlacedPrice = newPrice;
            lineItem.ExtendedPrice = lineItem.PlacedPrice * lineItem.Quantity;
			CurrentOrderGroup.BillingCurrency = newCurrencyCode;
		}