I noticed something odd about Private (Locked) items. They still show up as options in Upsell, even when they are set to Private.
My understanding is that the entire point of having an item marked as Private is to prevent it from being seen by the public.
Is this a bug, or is it intentional?
Private / Locked items still show up in Upsell
Re: Private / Locked items still show up in Upsell
Can you double check the following file in your site? Its the one that is used in the /ProductAccessories.aspx file
Conlib/ProductAccessoriesGrid.ascx.cs
Find: ProductList.DataSource = _Product.GetUpsellProducts(true, true);
Just make sure both options in GetUpsellProducts are set to true.
Conlib/ProductAccessoriesGrid.ascx.cs
Find: ProductList.DataSource = _Product.GetUpsellProducts(true, true);
Just make sure both options in GetUpsellProducts are set to true.
Ryan A.
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3
Re: Private / Locked items still show up in Upsell
BC_Bo -
Which version are you using? This is a bug from one of our older versions.
Thanks
Katie
Which version are you using? This is a bug from one of our older versions.
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
Re: Private / Locked items still show up in Upsell
Thanks for the responses.
It looks like the code for Conlib/ProductAccessoriesGrid.ascx.cs is correct.
My version is Gold R9 (VERSION: 7.0.89.7670)
I just confirmed that this is still an issue. Private items show up in Upsell whether I add them as a Private item or an Upsell item is made Private. Hidden items also appear, but I believe that's how it's supposed to be.
It looks like the code for Conlib/ProductAccessoriesGrid.ascx.cs is correct.
Code: Select all
{
CaptionLabel.Text = string.Format(CaptionLabel.Text, _Product.Name);
InstructionText.Text = string.Format(InstructionText.Text, _Product.Name);
KeepShoppingLink.NavigateUrl = AbleCommerce.Code.NavigationHelper.GetReturnUrl(AbleCommerce.Code.NavigationHelper.GetLastShoppingUrl());
ProductList.RepeatColumns = this.Columns;
ProductList.DataSource = _Product.GetUpsellProducts(true, true);
ProductList.DataBind();
}
I just confirmed that this is still an issue. Private items show up in Upsell whether I add them as a Private item or an Upsell item is made Private. Hidden items also appear, but I believe that's how it's supposed to be.
Re: Private / Locked items still show up in Upsell
I just tested using the Printer sample product which has Printer paper as an up-sell item. When I added the Printer to the cart, the ProductAccessories.aspx page appeared with the paper as one up-sell choice. Then I cleared the cart and changed the visibility of the paper to private. When I added the printer on the second test, the paper was not one of the choices.
I also tested as an admin user and guest user. The results are the same. This appears to be working fine and we've had no one else report it, so there must be some subtle difference between our two installs. The bug that I was thinking of before was actually in the Related products control and that was fixed awhile ago.
Thanks
Katie
I also tested as an admin user and guest user. The results are the same. This appears to be working fine and we've had no one else report it, so there must be some subtle difference between our two installs. The bug that I was thinking of before was actually in the Related products control and that was fixed awhile ago.
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
Re: Private / Locked items still show up in Upsell
Sorry Katie, it was a bug in my code.
The _Product object has two ways to access the child Upsell entities. You can reference _Product.UpsellProducts directly to reach the collection. But the collection returned is unfiltered and includes any visibility.
The correct way is to use the _Product.GetUpsellProducts() method which accepts a parameter to filter the returned collection for visible upsell products only. Doing it this way resolved the issue.
The _Product object has two ways to access the child Upsell entities. You can reference _Product.UpsellProducts directly to reach the collection. But the collection returned is unfiltered and includes any visibility.
The correct way is to use the _Product.GetUpsellProducts() method which accepts a parameter to filter the returned collection for visible upsell products only. Doing it this way resolved the issue.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com