Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit e5e45da

Browse files
authored
Merge pull request #1394 from pkarw/develop
Fixed configurable filter setCurrent issue
2 parents 5233df4 + 795c9fa commit e5e45da

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

core/components/blocks/SearchPanel/SearchPanel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export default {
3838

3939
query = query.andQuery('bool', b => b.orQuery('match', 'name', { query: queryText, boost: 3 })
4040
.orQuery('match', 'category.name', { query: queryText, boost: 1 })
41+
.orQuery('match', 'sku', { query: queryText, boost: 1 })
42+
.orQuery('match', 'configurable_children.sku', { query: queryText, boost: 1 })
4143
.orQuery('match', 'short_description', { query: queryText, boost: 2 })
4244
.orQuery('match', 'description', { query: queryText, boost: 1 }))
4345
query = query.build()

core/store/modules/product/helpers.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ import union from 'lodash-es/union'
1010
import { optionLabel } from '../attribute/helpers'
1111
import i18n from '../../lib/i18n'
1212
import { currentStoreView } from '../../lib/multistore'
13-
import * as types from '../../mutation-types'
1413

1514
function _filterRootProductByStockitem (context, stockItem, product, errorCallback) {
1615
if (stockItem) {
1716
product.stock = stockItem
1817
if (stockItem.is_in_stock === false) {
1918
product.errors.variants = i18n.t('No available product variants')
2019
context.state.current.errors = product.errors
21-
context.commit(types.CATALOG_SET_PRODUCT_CURRENT, product) // just override the reference to not miss changes in the configurable_children
2220
EventBus.$emit('product-after-removevariant', { product: product })
2321
if (config.products.listOutOfStockProducts === false) {
2422
errorCallback(new Error('Product query returned empty result'))
@@ -64,11 +62,7 @@ function _filterChildrenByStockitem (context, stockItems, product, diffLog) {
6462
context.state.current_options[optionKey] = optionsAvailable
6563
}
6664
}
67-
if (removedOptions > 0) {
68-
configureProductAsync(context, { product, configuration: context.state.current_configuration, selectDefaultVariant: true, fallbackToDefaultWhenNoAvailable: true })
69-
} else {
70-
context.commit(types.CATALOG_SET_PRODUCT_CURRENT, product) // just override the reference to not miss changes in the configurable_children
71-
}
65+
configureProductAsync(context, { product, configuration: context.state.current_configuration, selectDefaultVariant: true, fallbackToDefaultWhenNoAvailable: true })
7266
if (totalOptions === 0) {
7367
product.errors.variants = i18n.t('No available product variants')
7468
context.state.current.errors = product.errors

0 commit comments

Comments
 (0)