Tea Commerce 3 doesn't use the XML cache anymore as it has been removed. Could you check the orders in the DB and see if anyone has the customer id you are asking about?
I've tried to hard code my store ID and a user ID but with the same results - the orders collection has 0 items. Here is a database shot and the code in context
Thanks, Geoff
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using TeaCommerce.Umbraco.Web;
@using TeaCommerce.Api.Models;
@using Umbraco.Web.Models;
@using Umbraco.Core.Models;
@using Umbraco.Core;
@using Umbraco.Core.Services;
@{
Layout ="MegaMusic.cshtml";
}
@section Content{
@{
long storeId =Convert.ToInt64(Model.Content.GetPropertyValue("store", true));
var loginModel =newLoginModel();
var memberId = Members.GetCurrentMemberId();
var memberModel = Members.GetCurrentMemberProfileModel();
var member =ApplicationContext.Current.Services.MemberService.GetByEmail(memberModel.Email);
TeaCommerce 3 GetFinalizedOrdersForCustomer returns 0 orders
I'm trying to show orders for a customer using Tea Commerce 3 on Umbraco 7.1
The following code (called with the correct store ID and customer ID returns zero orders
IEnumerable<Order> orders = TC.GetFinalizedOrdersForCustomer(storeId, member.Id.ToString());
The back end shows orders and the database has finalized orders in TeaCommerce_Order. I've tried deleting the XML file in App_Data/tea-commerce also.
Any ideas?
Thanks
Geoff
Hi Geoff
Tea Commerce 3 doesn't use the XML cache anymore as it has been removed. Could you check the orders in the DB and see if anyone has the customer id you are asking about?
Kind regards
Anders
Hi Anders,
I've tried to hard code my store ID and a user ID but with the same results - the orders collection has 0 items. Here is a database shot and the code in context
Thanks, Geoff
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using TeaCommerce.Umbraco.Web;
@using TeaCommerce.Api.Models;
@using Umbraco.Web.Models;
@using Umbraco.Core.Models;
@using Umbraco.Core;
@using Umbraco.Core.Services;
@{
Layout ="MegaMusic.cshtml";
}
@section Content{
@{
long storeId = Convert.ToInt64(Model.Content.GetPropertyValue("store", true));
var loginModel = new LoginModel();
var memberId = Members.GetCurrentMemberId();
var memberModel = Members.GetCurrentMemberProfileModel();
var member = ApplicationContext.Current.Services.MemberService.GetByEmail(memberModel.Email);
IEnumerable<Order> orders = TC.GetFinalizedOrdersForCustomer(1, "20369"); //(storeId, member.Id.ToString());
}
<divclass="grid-100 mobile-full-width">
<divclass="content-block default-bg">
<h1>Orders For @member.Properties["firstName"].Value</h1>
@foreach (var order in orders)
{
<p>@order.DateCreated.ToString("dd/MM/yyyy") @order.TotalPrice.ToString()</p>
}
</div>
</div>
}
Hello
I have exactly the same problem.
The username is displayed, but "orders" is empty.
Kasper
I see that there is a bug. Could you report it at GitHub - thanks. https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco
Kind regards
Anders
I've posted this as an issue on GitHub.
Kind regards
Geoff
It will be fixed in 3.0.1
It works for me after installed 3.0.1,
thanks!
This works for me now also in version 3.0.1
Thanks,
Geoff
is working on a reply...