logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Wednesday, November 11, 2020 11:13:56 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
For one product in a category, more category items doesn't show anything even though there are other products in the category and the other products in the category show items in more category items. I'm trying to figure out what is going on by debugging the sql query. It ends up being the following, but then eliminates the product 4056, since that is the product being viewed.
SELECT TOP 5 CN.* FROM ac_CatalogNodes AS CN INNER JOIN ac_Products AS P
ON CN.CatalogNodeId = P.ProductId WHERE CN.CategoryId = 125
AND CN.CatalogNodeTypeId = 1 AND CN.OrderBy >-8
AND CN.OrderBy < 8
AND P.VisibilityId = 0 ORDER BY ABS (CN.OrderBy - 0)

I can't figure out your logic on
int minOrderBy = currentOrderBy - 2 * parameters.MaxItems;
int maxOrderBy = currentOrderBy + 2 * parameters.MaxItems;

In this case, the minOrderBy is -8 and maxOrderBy is 8 because the order by of this product is 0.
If I take out the minOrderBy and the maxOrderBy, it returns 5 products, whose orderby s are 25,26,27,28.

I fixed this by moving the first product in the admin, then moving it back again.


Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shari  
#2 Posted : Thursday, November 12, 2020 4:04:33 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thanks for the explanation.

Quote:
I can't figure out your logic on
int minOrderBy = currentOrderBy - 2 * parameters.MaxItems;
int maxOrderBy = currentOrderBy + 2 * parameters.MaxItems;


We are actually listing the products in More Category Items that are closest to the product being viewed. And this logic is actually looking for the nearest products to the product actually being viewed.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.