Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -695,13 +695,19 @@ ORDER BY d.id, r.priority DESC, r.id
|
|||||||
}
|
}
|
||||||
out := make([]productSeriesAutoRule, 0, len(byID))
|
out := make([]productSeriesAutoRule, 0, len(byID))
|
||||||
for _, r := range byID {
|
for _, r := range byID {
|
||||||
if len(r.Ratio) == 0 {
|
// Always augment ratio map from the dfgrp.title tokens.
|
||||||
for _, part := range strings.Split(r.Title, "-") {
|
// mk_product_series_rule can be partially populated (or manually edited), which would allow
|
||||||
size := normalizeProductSeriesSize(part)
|
// a "subset" rule (e.g. only M+XL) to match stock and incorrectly assign a series like
|
||||||
if size != "" {
|
// "XS-S-M-L-XL-2XL". Title tokens are the canonical definition of a series in this setup.
|
||||||
r.Ratio[size] = 1
|
for _, part := range strings.Split(r.Title, "-") {
|
||||||
}
|
size := normalizeProductSeriesSize(part)
|
||||||
|
if size == "" {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
if _, ok := r.Ratio[size]; ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
r.Ratio[size] = 1
|
||||||
}
|
}
|
||||||
if len(r.Ratio) > 0 {
|
if len(r.Ratio) > 0 {
|
||||||
out = append(out, *r)
|
out = append(out, *r)
|
||||||
|
|||||||
Reference in New Issue
Block a user