Issue #2147
This commit is contained in:
parent
cbaebaa388
commit
4fd6599bda
|
|
@ -45,6 +45,14 @@ class BundleOption extends AbstractProduct
|
|||
$options[$option->id] = $this->getOptionItemData($option);
|
||||
}
|
||||
|
||||
usort ($options, function($a, $b) {
|
||||
if ($a['sort_order'] == $b['sort_order']) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($a['sort_order'] < $b['sort_order']) ? -1 : 1;
|
||||
});
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
|
|
@ -83,10 +91,19 @@ class BundleOption extends AbstractProduct
|
|||
'price' => $bundleOptionProduct->product->getTypeInstance()->getProductPrices(),
|
||||
'name' => $bundleOptionProduct->product->name,
|
||||
'product_id' => $bundleOptionProduct->product_id,
|
||||
'is_default' => $bundleOptionProduct->is_default
|
||||
'is_default' => $bundleOptionProduct->is_default,
|
||||
'sort_order' => $bundleOptionProduct->sort_order
|
||||
];
|
||||
}
|
||||
|
||||
usort ($products, function($a, $b) {
|
||||
if ($a['sort_order'] == $b['sort_order']) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($a['sort_order'] < $b['sort_order']) ? -1 : 1;
|
||||
});
|
||||
|
||||
return $products;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue