two importan features are abandoned cart and statistics on wish lists.
Abandonend cart: a not finalized cart must be saved into database or all cart must be saved with its status and customer or anonymous. So, after, with a push messages a store manager can send email to says why or an offer.
Wish lists: a manager can have a list of top wish list products or wish list products for customers and the made some marketing actions.
The carts themselves (both anonymous and customer) are saved to the database and only cleared when the customer completes a purchase, in which case they have an invoice or the Anonymous customers are cleaned up with the optional scheduled task or with some other custom code.
The data is in the itemCache and itemCacheItem tables.
I have just recently done this but had to write a SQL Query to achieve it in v2.2. In my case, I only wanted to list abandoned baskets with contact details so that the store owner could contact them to try and complete the sales.
It's a but rough at the moment and needs tidying up so I can page results but it should help anyone that might be trying to do something similar:
var db = UmbracoContext.Application.DatabaseContext.Database;
var itemCacheType = EnumTypeFieldConverter.ItemItemCache.GetTypeField(_itemCacheType).TypeKey;
var sqlquery = @"SELECT itemCacheKey FROM merchItemCache T1
INNER JOIN (
SELECT pk, lastActivityDate
FROM [merchAnonymousCustomer]
WHERE lastActivityDate BETWEEN @start AND @end
) Q1 ON T1.entityKey = Q1.pk
INNER JOIN (
SELECT COUNT(*) AS itemCount,
itemCacheKey
FROM merchItemCacheItem
GROUP BY itemCacheKey
) Q2 ON T1.pk = Q2.itemCacheKey
WHERE Q2.itemCount > 0 AND
T1.itemCacheTfKey = @itemCacheType
ORDER BY Q1.lastActivityDate DESC";
var sql = new Sql(sqlquery, new { @start = this._startDate, @end = this._endDate, @itemCacheType = itemCacheType });
IEnumerable<Guid> keys = db.Fetch<Guid>(sql);
var itemCache =
_itemCacheService.GetByKeys(keys).Where(x => x.Items.Any(y => y.LineItemType == LineItemType.Shipping));
// The baskets
var items = new List<AnonymousCustomerItemCacheDisplay>();
//itemCache.Select(x => x.ToAnonymousCustomerItemCacheDisplay());
foreach (var basket in itemCache)
{
var customer = this._customerService.GetAnyByKey(basket.EntityKey);
IAddress address = customer.ExtendedData.GetAddress(Merchello.Core.Constants.ExtendedDataKeys.BillingAddress);
if (address != null && !string.IsNullOrEmpty(address.Email))
{
items.Add(basket.ToAnonymousCustomerItemCacheDisplay(customer, address));
}
}
Yes, the idea is to put together a collection of whatever reports your client needs for their install. If they are generic enough, it would be great to offer them as a package so that everyone can use them.
Features: abandoned cart and wish list
Hi,
two importan features are abandoned cart and statistics on wish lists.
Abandonend cart: a not finalized cart must be saved into database or all cart must be saved with its status and customer or anonymous. So, after, with a push messages a store manager can send email to says why or an offer.
Wish lists: a manager can have a list of top wish list products or wish list products for customers and the made some marketing actions.
The carts themselves (both anonymous and customer) are saved to the database and only cleared when the customer completes a purchase, in which case they have an invoice or the Anonymous customers are cleaned up with the optional scheduled task or with some other custom code.
The data is in the itemCache and itemCacheItem tables.
Creating a report for the wishlist and/or abandoned carts would be done like http://merchello.com/documentation/getting-started/how-to/report
Of course we would love to add these sorts of things to the core ... pull request =)
How to check or list the not finalized carts with Merchello API?
At present you have to use the
ItemCacheServicewith ItemCacheType.Basket.I'll add a few more methods to the service to give more control over the results.
I have just recently done this but had to write a SQL Query to achieve it in v2.2. In my case, I only wanted to list abandoned baskets with contact details so that the store owner could contact them to try and complete the sales.
It's a but rough at the moment and needs tidying up so I can page results but it should help anyone that might be trying to do something similar:
Is the same for the wish lists?
Yes, the idea is to put together a collection of whatever reports your client needs for their install. If they are generic enough, it would be great to offer them as a package so that everyone can use them.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.