Skip to content

Totals Information Management - setting quote shipping method when address method is null #25147

Closed
@joe-vortex

Description

@joe-vortex

Preconditions (*)

  1. 2.3.2(2.3-develop) Magento Commerce or Open Source
  2. Amasty Conditions module installed (cannot reproduce with vanilla m2 because this)
  3. PHP 7.2.21

Steps to reproduce (*)

  1. On the checkout, the component Amasty_Conditions/js/action/recollect-totals makes a call to /V1/guest-carts/:cartId/totals-information which passes through Magento\Checkout\Model\TotalsInformationManagement
  2. In this model the following:
$quote->getShippingAddress()->setCollectShippingRates(true)->setShippingMethod(
     $addressInformation->getShippingCarrierCode() . '_' . $addressInformation->getShippingMethodCode()
);

is set, but when a shipping method has not been selected, it will return the quote shipping method with a total of 0 and a name of _, because $addressInformation->getShippingCarrierCode() and method code are null - so setShippingMethod('_') happens in effect.
3. This then means that validation for the shipping method is bypassed.
4. An order can then be placed without shipping information/carrier

Expected result (*)

  1. If the address info has the shipping carrier and/or method code set to null, the setShippingMethod should not be called and the quote total is returned without setting a shipping code pair

Actual result (*)

  1. When a address info instance is submitted with shipping codes set to null, a method is set with label _ and zero value, meaning an order can be placed without a valid shipping method.

Metadata

Metadata

Assignees

Labels

Component: Bundled ExtensionIssue is caused by one of the bundled extensionsComponent: CheckoutFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPartner: AYKOProgress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions