Skip to content

Can not place order where coupon code is applied #135

@ijozwiak

Description

@ijozwiak

We spotted issue that there is no possibility to place order because missing shipping method.

Step to reproduce

  1. Configure different matrix
Country Region/State City Zip/Postal Code From Zip/Postal Code To Order Subtotal > Order Subtotal <= Shipping Price
CHE * * * * -1.0000 59.9900 6.5000
CHE * * * * -1.0000 59.9900 9.0000
CHE * * * * 59.9900 99999999.9999 0.0000
CHE * * * * 59.9900 99999999.9999 2.5000
  1. Add product to the cart which is more expensive than 60 euro
  2. go to the last step
  3. choose payment method
  4. apply coupon code with free shipping
  5. try to place order
  6. you can find in logs that the shipping method is not set

The issue comes from the below code:
vendor/webshopapps/module-matrixrate/src/Model/Carrier/Matrixrate.php?ref_type=heads#L152

} elseif ($item->getFreeShipping()) {
    $freeShipping = is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0;
    $freeQty += $item->getQty() - $freeShipping;
    $freePackageValue += $item->getBaseRowTotal();
}

If I removed it shipping method is not reseted and order is able to be placed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions