mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Updated sorted price list in product details
refs https://github.com/TryGhost/Team/issues/641 By default, the prices list for a Product will be now shown sorted based on this order -> Active -> Currency -> Amount.
This commit is contained in:
parent
575f85a8ca
commit
fab98939fd
1 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,12 @@ export default class ProductController extends Controller {
|
||||||
...d,
|
...d,
|
||||||
amount: d.amount / 100
|
amount: d.amount / 100
|
||||||
};
|
};
|
||||||
|
}).sort((a, b) => {
|
||||||
|
return a.amount - b.amount;
|
||||||
|
}).sort((a, b) => {
|
||||||
|
return a.currency.localeCompare(b.currency, undefined, {ignorePunctuation: true});
|
||||||
|
}).sort((a, b) => {
|
||||||
|
return (a.active === b.active) ? 0 : (a.active ? -1 : 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue