How to calculate total based on selected items