[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:
parent
2c52b6ab7e
commit
931aec84e8
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
[Linked products] - Change number of 'choose products for me' to 4 #46094
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue