Page 1 of 1
What Happened to the Whats New Feature?
Posted: Thu Apr 17, 2014 5:42 pm
by VIPER7
In Able Commerce 5.5, we had the What's New feature (newprods.aspx), where we could see all new products recently added to the site. I'm not seeing this in Gold. Is it there somewhere and I'm just missing it or was it removed. Was a VERY helpful feature.
Re: What Happened to the Whats New Feature?
Posted: Fri Apr 18, 2014 8:58 am
by Katie
I guess we just missed it years ago and no one has said anything. It came up in some discussions a few weeks back and I requested the feature. It will be in the next version of Gold R8.
Re: What Happened to the Whats New Feature?
Posted: Fri Apr 18, 2014 10:58 am
by VIPER7
Thanks Katie. I have a client that I am upgrading from AC 5.5 to Gold and he misses it sorely, and we haven't even launched yet. It helps him in more ways than just customers seeing what he has added to his site lately, which he works on daily. I woudln't think it'd be too awfully difficult. Just run a query and display products sorted by date most recent,right?

Re: What Happened to the Whats New Feature?
Posted: Mon Apr 21, 2014 5:52 am
by jguengerich
I guess the closest thing in Gold would be in the Admin UI, you can go to the Products page (the blue t-shirt icon) and sort on the Last Modified column. That doesn't help for the store front, but it least it could help the store owner keep track of what he's been working on. You could customize the code on that page to show the CreatedDate field instead of or in addition to the LastModifiedDate field.
Re: What Happened to the Whats New Feature?
Posted: Wed Apr 23, 2014 12:41 am
by ForumsAdmin
This has been done for our next release.
Re: What Happened to the Whats New Feature?
Posted: Thu Apr 24, 2014 3:24 pm
by VIPER7
Super! Thanks for listening! Looking forward to having the functionality back!
Re: What Happened to the Whats New Feature?
Posted: Tue Apr 29, 2014 9:05 am
by VIPER7
As a workaround for now, could my client create a custom category called "What's New" and simply add Latest Modified products to this category (along with the correct category the product belongs to)? Is there a way to assign multiple products to a category at once? How soon until this feature is available, realistically?
Re: What Happened to the Whats New Feature?
Posted: Wed May 21, 2014 9:15 am
by VIPER7
Does anyone have an idea when this former feature (What's New) will once again be available in AbleCommerce?
Re: What Happened to the Whats New Feature?
Posted: Wed May 21, 2014 11:19 pm
by ForumsAdmin
In the very next release ... R8.
Re: What Happened to the Whats New Feature?
Posted: Wed May 21, 2014 11:22 pm
by ForumsAdmin
If you can't wait for R8, use the following code to load the new products and display them in your custom control.
Code: Select all
public IList<Product> GetNewProducts(bool useDays, int numberOfDays, string sortExpression = "LastModifiedDate DESC", int maximumRows = 0, int startRowIndex = 0)
{
DateTime date = new DateTime();
if (useDays && numberOfDays > 0)
{
date = LocaleHelper.LocalNow.AddDays(-1 * numberOfDays);
}
ICriteria criteria = NHibernateHelper.CreateCriteria<Product>("P", maximumRows, startRowIndex, sortExpression)
.Add(Restrictions.Eq("P.DisablePurchase", false))
.Add(Restrictions.Eq("P.VisibilityId", (byte)CatalogVisibility.Public));
if (useDays)
{
Disjunction firstCriteria = new Disjunction();
firstCriteria.Add(Restrictions.Ge("P.CreatedDate", date))
.Add(Restrictions.Ge("P.LastModifiedDate", date));
criteria.Add(firstCriteria);
}
// LIMIT PRODUCTS BY USER GROUP RESTRICTIONS
var user = AbleContext.Current.User;
int[] groupIds = null;
if (user != null) groupIds = (from ug in user.UserGroups select ug.GroupId).ToList<int>().ToArray();
else groupIds = new int[0];
if (!user.IsAdmin)
{
if (groupIds.Length > 0)
{
Disjunction disjunction = new Disjunction();
DetachedCriteria secondCriteria = DetachedCriteria.For<ProductGroup>("PG")
.Add(Restrictions.EqProperty("PG.Product.Id", "P.Id"))
.Add(Restrictions.In("PG.Group.Id", groupIds))
.SetProjection(Projections.Property("PG.Group.Id"));
disjunction.Add(Restrictions.Eq("P.EnableGroups", false));
disjunction.Add(Subqueries.Exists(secondCriteria));
criteria.Add(disjunction);
}
else
{
criteria.Add(Restrictions.Eq("P.EnableGroups", false));
}
}
return criteria.List<Product>();
}
Re: What Happened to the Whats New Feature?
Posted: Thu May 22, 2014 7:21 am
by VIPER7
Thanks! I'll give this a go, if I can figure out where to implement it!

Re: What Happened to the Whats New Feature?
Posted: Fri May 30, 2014 10:24 am
by VIPER7
Ok, I am struggling with this just a bit. How do you add a custom control so that it shows up in the control list where I would add this code? A little guidance to get this up and running would be greatly appreciated! TIA!