Skip to content

Feature request: Add ability to "exclude current product" from the Product Collection block #42572

@opr

Description

@opr

Is your feature request related to a problem? Please describe.

I have a store and I am using the "All Products Block" on the product page. I would like to display "other" products in my store with the exception of the one the user is currently on.

Describe the solution you'd like

I think an option in the editor to exclude the current product would be great. The option could even be hidden if the current post is not of type product.

Describe alternatives you've considered

I've tried Hand Picked Products, but in a store with continually changing inventory it would be inconvenient to edit every product's instance of the Hand Picked Products block. All products achieves the desired outcome, but it contains the current product too.

Additional context

To enable the block editor for a single product I used:

function kogarashi_activate_gutenberg_for_product( $can_edit, $post_type )
{
		if ( $post_type == 'product' ) {
			$can_edit = true;
		}
	return $can_edit;
}

add_filter(
	'use_block_editor_for_post_type',
	'kogarashi_activate_gutenberg_for_product',
	20,
	2
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementThe issue is a request for an enhancement.KirigamiWC Store Editing (FSE)block: product collectionIssues related to the Product Collection blockneeds: designThe issue requires design input/work from a designer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions