[Linked products] - Change number of 'choose products for me' to 4 (#46094)

* Add limit to "choose products for me"

* Add changelog
This commit is contained in:
Fernando Marichal 2024-04-05 11:35:59 -03:00 committed by GitHub
parent 2c52b6ab7e
commit 931aec84e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
[Linked products] - Change number of 'choose products for me' to 4 #46094

View File

@ -12,6 +12,7 @@ type getRelatedProductsOptions = {
const POSTS_NUMBER_TO_RANDOMIZE = 30;
const POSTS_NUMBER_TO_PICK = 3;
const POSTS_NUMBER_TO_DISPLAY = 4;
/**
* Return related products for a given product ID.
@ -99,6 +100,7 @@ export async function getSuggestedProductsFor( {
: [],
tags: data?.tags ? data.tags.map( ( tag ) => tag.id ) : [],
exclude: exclude?.length ? exclude : [ postId ],
limit: POSTS_NUMBER_TO_DISPLAY,
};
if ( forceRequest ) {