Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...

AspDotNetStorefront
DotFeed

Add paging/pagination top related products

1.) I would like to add pagination to the related products

I want to add all products in the same category to related products

Typically 100+ related products so I would like to have these paginated in a single row displaying 100+ products on scroll down is not a good looking page :)

 

2.) how to assign relate products by category id instead of prouduct id ?

Assigning 100+ related products manually just sucks .......
asked Sep 28 in MultiStore by aflorestal (225 points)

1 Answer

0 votes

Both of these would be a customizatons that would require a developer.

For the pagination you would most likely want to pull the entire set of related products and them move through them horizontally with Javascript, similiar to an image carousel.  Otherwise you'll need to add paging support to the aspdnsf_GetCustomersRelatedProducts stored procedure, which would  only complicate the customization.

As for the assignment by category, that too would be a modification to aspdnsf_GetCustomersRelatedProducts.  I'm assuming you'd want to enter category ids instead of product ids for the related products in the product editor.  Then in the aspdnsf_GetCustomersRelatedProducts stored procedure you'd need to get the products assigned to the category and use those for the related products.  This wouldn't be as difficult as the paging.  It would just be a few lines of SQL right before queries that pull the related products.  Something like:

...
--Temp table for fixed related categories
declare @RelatedCategories VARCHAR(8000)
select @RelatedCategories = replace(cast(relatedproducts as varchar(8000)), ' ', '') from dbo.product with (NOLOCK) where productid = @productid
DECLARE @RelatedCategoriesTable table (CategoryID int not null)
insert into @RelatedCategoriesTable select distinct * from dbo.Split(@RelatedCategories, ',')

--Temp table for fixed related products
-- Don't use the following query because we're using category ids not product ids
--select @relatedprods = replace(cast(relatedproducts as varchar(8000)), ' ', '') from dbo.product with (NOLOCK) where productid = @productid
DECLARE @RelatedProductsTable table (ProductId int not null)
insert into @RelatedProductsTable select distinct productid from productcategory where categoryid in (select categoryid from @RelatedCategoriesTable)
...

Note that in the product editor you won't be able to use the related products helper, as it is tied to products.  You'll have to enter the category ids manually.

answered Oct 1 by Vortx Joe (510 points)
...