/// <summary> /// Initializes the <see cref="MerchelloControllerBase"/> /// </summary> private void Initialize() { var customerContext = new CustomerContext(UmbracoContext); _currentCustomer = customerContext.CurrentCustomer; _home = new Lazy <IPublishedContent>(GetHomePage); _basket = _currentCustomer.Basket(); }
protected MerchelloSurfaceContoller(IMerchelloContext merchelloContext) { if (merchelloContext == null) { var ex = new ArgumentNullException("merchelloContext"); LogHelper.Error<MerchelloSurfaceContoller>("The MerchelloContext was null upon instantiating the CartController.", ex); throw ex; } _merchelloContext = merchelloContext; var customerContext = new CustomerContext(UmbracoContext); // UmbracoContext is from SurfaceController _currentCustomer = customerContext.CurrentCustomer; _basket = _currentCustomer.Basket(); }
protected MerchelloSurfaceContoller(IMerchelloContext merchelloContext) { if (merchelloContext == null) { var ex = new ArgumentNullException("merchelloContext"); LogHelper.Error <MerchelloSurfaceContoller>("The MerchelloContext was null upon instantiating the CartController.", ex); throw ex; } _merchelloContext = merchelloContext; var customerContext = new CustomerContext(UmbracoContext); // UmbracoContext is from SurfaceController _currentCustomer = customerContext.CurrentCustomer; _basket = _currentCustomer.Basket(); }