Simple and Grouped products on category pages - question

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 yıl önce
Hello. Is there a way to have a specific simple product NOT shown in the category product list, BUT still have it accessible via the search.

An example of this behavior in the real world...
1. go here: https://www.uline.com/Grp_5/Poly-Bags-Reclosable (this is a category page for Poly Bags Reclosable)
2. Click on 2 ml (first link/image) This takes you to a grouped product page.

The simple products on the page are not shown on the category page (step 1), yet you can enter any of the model numbers or sizes in the search and find them.

I am working on a site that needs behavior LIKE that.

Thanks,

David
7 yıl önce
ddegil wrote:
Hello. Is there a way to have a specific simple product NOT shown in the category product list, BUT still have it accessible via the search.

An example of this behavior in the real world...
1. go here: https://www.uline.com/Grp_5/Poly-Bags-Reclosable (this is a category page for Poly Bags Reclosable)
2. Click on 2 ml (first link/image) This takes you to a grouped product page.

The simple products on the page are not shown on the category page (step 1), yet you can enter any of the model numbers or sizes in the search and find them.

I am working on a site that needs behavior LIKE that.

Thanks,

David

Yes. Don't map it to the category but tag it as "Visible individually"
7 yıl önce
Tecnofin wrote:
Yes. Don't map it to the category but tag it as "Visible individually"

I thought of that, BUT we want the product pages to show the category bread crumb to people know where it is. Some of the products will have the same name as other products in other categories, so it is important to maintain the category bread crumb.
7 yıl önce
The thing that stops products without the VisibleIndividually flag being returned in search results is this line in the Search ActionResult of the CatalogController which sets the visibleIndividuallyOnly parameter to true:

//products
products = _productService.SearchProducts(
    categoryIds: categoryIds,
    manufacturerId: manufacturerId,
    storeId: _storeContext.CurrentStore.Id,
    visibleIndividuallyOnly: true,
    priceMin: minPriceConverted,
    priceMax: maxPriceConverted,
    keywords: searchTerms,
    searchDescriptions: searchInDescriptions,
    searchProductTags: searchInProductTags,
    languageId: _workContext.WorkingLanguage.Id,
    orderBy: (ProductSortingEnum)command.OrderBy,
    pageIndex: command.PageNumber - 1,
    pageSize: command.PageSize,
    vendorId: vendorId);
model.Products = PrepareProductOverviewModels(products).ToList();

If you were to change the visibleIndividuallyOnly parameter to false then the search function should return all products on searches whilst leaving the usual category display functionality unchanged.

I've not tried it but I think it should work, the only thing I'm not sure about is what those returned single products would link to since they wouldn't usually have their own urls. Maybe they would link to their parent Grouped product or maybe it would require further code changes.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.