allow suggestions to target multiple contexts:
If an array of context strings is specified in json, the suggestion will be available for display in all specified contexts.
This commit is contained in:
parent
041068a705
commit
1df74d504e
|
@ -198,6 +198,9 @@
|
|||
function getRelevantPromotions( marketplaceSuggestionsApiData, displayContext ) {
|
||||
// select based on display context
|
||||
var promos = _.filter( marketplaceSuggestionsApiData, function( promo ) {
|
||||
if ( _.isArray( promo.context ) ) {
|
||||
return _.contains( promo.context, displayContext );
|
||||
}
|
||||
return ( displayContext === promo.context );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in New Issue