Skip to content

Commit

Permalink
Fix Notice: freePackageValue is undefined
Browse files Browse the repository at this point in the history
As visible from the code, freePackageValue can be undefined in some cases but accessed. `$request->getAllItems() == false` and `$request->getPackageQty() == $freeQty` is true and `!empty($rate) && $rate['price'] >= 0` is false This fixes this
  • Loading branch information
amenk authored Oct 25, 2017
1 parent 08f0056 commit f642811
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ public function collectRates(RateRequest $request)

// Free shipping by qty
$freeQty = 0;
$freePackageValue = 0;

if ($request->getAllItems()) {
$freePackageValue = 0;
foreach ($request->getAllItems() as $item) {
if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
continue;
Expand Down

0 comments on commit f642811

Please sign in to comment.