File tree 1 file changed +1
-24
lines changed
app/code/Magento/Quote/Model/Quote
1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -221,31 +221,8 @@ protected function _validateCouponCode(\Magento\Quote\Model\Quote $quote)
221
221
*/
222
222
protected function _collectItemsQtys (\Magento \Quote \Model \Quote $ quote )
223
223
{
224
- $ quoteItems = $ quote ->getAllVisibleItems ();
225
- $ quote ->setItemsCount (0 );
226
- $ quote ->setItemsQty (0 );
227
- $ quote ->setVirtualItemsQty (0 );
228
-
229
- foreach ($ quoteItems as $ item ) {
230
- if ($ item ->getParentItem ()) {
231
- continue ;
232
- }
233
-
234
- $ children = $ item ->getChildren ();
235
- if ($ children && $ item ->isShipSeparately ()) {
236
- foreach ($ children as $ child ) {
237
- if ($ child ->getProduct ()->getIsVirtual ()) {
238
- $ quote ->setVirtualItemsQty ($ quote ->getVirtualItemsQty () + $ child ->getQty () * $ item ->getQty ());
239
- }
240
- }
241
- }
224
+ $ this ->quantityCollector ->collectItemsQtys ($ quote );
242
225
243
- if ($ item ->getProduct ()->getIsVirtual ()) {
244
- $ quote ->setVirtualItemsQty ($ quote ->getVirtualItemsQty () + $ item ->getQty ());
245
- }
246
- $ quote ->setItemsCount ($ quote ->getItemsCount () + 1 );
247
- $ quote ->setItemsQty ((float )$ quote ->getItemsQty () + $ item ->getQty ());
248
- }
249
226
return $ this ;
250
227
}
251
228
You can’t perform that action at this time.
0 commit comments