Skip to content

Commit

Permalink
Only load products meta-data if loadByAttributeMetadata is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cewald committed Jun 16, 2020
1 parent 0f28c1b commit e97c7ce
Showing 1 changed file with 4 additions and 1 deletion.
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 })
}
}

0 comments on commit e97c7ce

Please sign in to comment.