File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
frontend/src/modules/constructor Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -124,18 +124,14 @@ export default {
124124 },
125125
126126 totalPrice () {
127- let price = 0 ;
127+ let basePrice = 0 ;
128128
129129 if (this .selectedDough ) {
130- price += this .selectedDough .price || 0 ;
131- }
132-
133- if (this .selectedSize ) {
134- price += this .selectedSize .price || 0 ;
130+ basePrice += this .selectedDough .price || 0 ;
135131 }
136132
137133 if (this .selectedSauce ) {
138- price += this .selectedSauce .price || 0 ;
134+ basePrice += this .selectedSauce .price || 0 ;
139135 }
140136
141137 Object .entries (this .selectedIngredients ).forEach (
@@ -144,12 +140,16 @@ export default {
144140 (ing ) => ing .id == ingredientId,
145141 );
146142 if (ingredient && count > 0 ) {
147- price += (ingredient .price || 0 ) * count;
143+ basePrice += (ingredient .price || 0 ) * count;
148144 }
149145 },
150146 );
151147
152- return price;
148+ if (this .selectedSize && this .selectedSize .multiplier ) {
149+ basePrice *= this .selectedSize .multiplier ;
150+ }
151+
152+ return Math .round (basePrice);
153153 },
154154
155155 canOrder () {
You can’t perform that action at this time.
0 commit comments