Skip to content

Conversation

@crydotsnake
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #119
License MIT

This PR makes sure that disabled products dont show in the product grid / carousels element.

If you click on a disabled product that is listed in the elements, it returns a exception.

@crydotsnake crydotsnake requested a review from a team as a code owner November 20, 2025 16:27
@crydotsnake crydotsnake force-pushed the bugfix/dont-show-disabled-products-in-grid-and-carousels-element branch from 0ed9f24 to 147a026 Compare November 22, 2025 08:55
@crydotsnake
Copy link
Member Author

Since I had to implement the same filter logic for four content elements, I would suggest adding a general PHP class to retrieve the products using the filter logic and using it within the four content elements.

This way, we avoid duplicate code.

@TheMilek TheMilek force-pushed the bugfix/dont-show-disabled-products-in-grid-and-carousels-element branch from 4fe6507 to 97e22f9 Compare January 20, 2026 13:34
@TheMilek TheMilek force-pushed the bugfix/dont-show-disabled-products-in-grid-and-carousels-element branch from 97e22f9 to 194a7ca Compare January 20, 2026 13:38
@GSadee GSadee added the Bug Confirmed bugs or bugfixes. label Jan 20, 2026
@TheMilek TheMilek force-pushed the bugfix/dont-show-disabled-products-in-grid-and-carousels-element branch from 194a7ca to 6e21963 Compare January 20, 2026 14:06
Comment on lines +65 to +72
foreach ($products as $product) {
if (
$product->isEnabled() &&
$product->hasChannel($currentChannel)
) {
$filteredProducts[] = $product;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more optimal to filter them out in the database query instead of using PHP for this purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Confirmed bugs or bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled products still shown in CMS page grids/carousels

3 participants