forked from vuestorefront/vue-storefront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only load products meta-data if
loadByAttributeMetadata
is enabled
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
core/modules/catalog/helpers/associatedProducts/setAttributesMetaFromProducts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import config from 'config' | ||
import Product from '@vue-storefront/core/modules/catalog/types/Product' | ||
|
||
/** | ||
* Set associated attributes by meta data of product links | ||
*/ | ||
export default async function setAttributesMetaFromProducts (context: any, products: Product[]) { | ||
context.dispatch('attribute/loadProductAttributes', { products, merge: true }, { root: true }) | ||
if (config.entities.attribute.loadByAttributeMetadata) { | ||
context.dispatch('attribute/loadProductAttributes', { products, merge: true }, { root: true }) | ||
} | ||
} |