Hi,
I am trying to use the ExportManager class to export any newly created orders straight to xml.
I have tried putting the following code in OpcConfirmOrder(), Confirm(), Completed() and OpcSavePaymentMethod() in the CheckoutController.cs file but the added code does not fire. I see in Chrome Developer tools that OpcConfirmOrder() and OpcSavePaymentMethod() fire. OpcSavePaymentMethod() returns a status code of 200 OK and returns some JSON but OpcConfirmOrder() does not return anything. There is no Response (Status Code = 200) or anything but it is getting called through the .Ajax(). I tried setting breakpoints in the C# code, but it does not hit any of the breakpoints anywhere in C# including OpcSavePaymentMethod() which the Chrome Developer Tools shows as getting called and returning a Status Code of 200 OK under the Network tab. I have also tried putting the code in OrderSummary() in ShoppingCartController.cs but it does not get called there either. There is no order.xml file.
The code I have put there is as follows:
IList<Order> ordersToExport = new List<Order>();
ordersToExport.Add(placeOrderResult.PlacedOrder);
ICacheManager cacheManager = EngineContext.Current.ContainerManager.Resolve<ICacheManager>("nop_cache_static");
IStoreService _storeService = EngineContext.Current.Resolve<IStoreService>();
ICategoryService _categoryService = EngineContext.Current.Resolve<ICategoryService>();
IManufacturerService _manufacturerService = MockRepository.GenerateMock<IManufacturerService>();
ICustomerService _customerService = EngineContext.Current.Resolve<ICustomerService>();
IProductAttributeService _productAttributeService = EngineContext.Current.Resolve<IProductAttributeService>();
IPictureService _pictureService = EngineContext.Current.Resolve<IPictureService>();
INewsLetterSubscriptionService _newsLetterSubscriptionService = EngineContext.Current.Resolve<INewsLetterSubscriptionService>();
ProductEditorSettings _productEditorSettings = new ProductEditorSettings();
IWorkContext _workContext = EngineContext.Current.Resolve<IWorkContext>();
IVendorService _vendorService = EngineContext.Current.Resolve<IVendorService>();
IProductTemplateService _productTemplateService = EngineContext.Current.Resolve<IProductTemplateService>();
IDateRangeService _dateRangeService = EngineContext.Current.Resolve<IDateRangeService>();
ITaxCategoryService _taxCategoryService = EngineContext.Current.Resolve<ITaxCategoryService>();
IMeasureService _measureService = EngineContext.Current.Resolve<IMeasureService>();
CatalogSettings _catalogSettings = new CatalogSettings();
IGenericAttributeService _genericAttributeService = EngineContext.Current.Resolve<IGenericAttributeService>();
ICustomerAttributeFormatter _customerAttributeFormatter = EngineContext.Current.Resolve<ICustomerAttributeFormatter>();
OrderSettings _orderSettings = new OrderSettings();
ExportManager exportManager = new ExportManager(_categoryService,
_manufacturerService, _customerService, _productAttributeService,
_pictureService, _newsLetterSubscriptionService,
_storeService, _workContext, _productEditorSettings,
_vendorService, _productTemplateService, _dateRangeService,
_taxCategoryService, _measureService, _catalogSettings,
_genericAttributeService, _customerAttributeFormatter, _orderSettings);
ControllerContext context = new ControllerContext();
var xml = exportManager.ExportOrdersToXml(ordersToExport);
XmlDownloadResult xmlResult = new XmlDownloadResult(xml, "orders.xml");
xmlResult.ExecuteResult(context);
Any suggestions on what is going on?
Saad