-
Notifications
You must be signed in to change notification settings - Fork 13
Bug fix: incorrect combine shipping dimensions features. #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,10 +264,12 @@ public static function extendItems(&$items, $units = array()) | |
|
|
||
| if ($dimensions = self::getShopSettings('shipping_dimensions')) { | ||
| $dimensions = preg_split('@\D+@', $dimensions); | ||
| $features = $feature_model->getByField((count($dimensions) == 1) ? 'parent_id' : 'id', $dimensions, true); | ||
| $features = $feature_model->getByField((count($dimensions) == 1) ? 'parent_id' : 'id', $dimensions, 'id'); | ||
|
|
||
| if (count($features) == 3) { | ||
| $map += array_combine($dimension_fields, array_values($features)); | ||
| foreach($dimension_fields as $dimension_field_key => $dimension_field) { | ||
| $map[$dimension_field] = $features[$dimensions[$dimension_field_key]]; | ||
| } | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Для понимания что было раньше и как сейчас будет работать. $dimensions = [ 94, 92, 93 ] До исправления: $map = [ 'height' => [ 'id' => 92, ... ], 'width' => [ 'id' => 93, ... ], 'length' => [ 'id' => 94, ... ] ] После: $map = [ 'height' => [ 'id' => 94, ... ], 'width' => [ 'id' => 92, ... ], 'length' => [ 'id' => 93, ... ] ] |
||
| if (isset($units['dimensions'])) { | ||
| foreach ($dimension_fields as $field) { | ||
| $units[$field] = $units['dimensions']; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно сохранить в ключах массива id характеристики, чтобы в цикле ниже найти информацию о характеристике по ее id.