Skip to content

Free Shipping Progress

Module: Magenx_FreeShippingGraphQl · no settings of its own · storefront flag features.freeShipping

Powers the “Add €12.50 more for free shipping” indicator on the product page and in the cart. It reads the threshold from Magento’s stock Free Shipping carrier and measures the cart the way the carrier does, so the promise always matches the rate at checkout.

Free shipping progress bar in the cart
Free-shipping progress in the cart.

The indicator compares the cart with the carrier’s Minimum Order Amount:

  • The cart subtotal after discounts is used, plus tax when the carrier’s Include Tax to Amount is on. This is the carrier’s own calculation.
  • Amounts come back in the cart’s currency.
  • The cart also qualifies when a cart price rule already gives it free shipping.

The storefront hides the indicator when:

  • the Free Shipping carrier is disabled;
  • the cart is virtual;
  • the cart ships to a country outside the carrier’s Ship to Specific Countries.

Everything is set on the stock carrier, in Stores > Configuration > Sales > Delivery Methods > Free Shipping:

SettingEffect on the indicator
EnabledOff hides the indicator.
Minimum Order AmountThe threshold. 0 means every order ships free.
Include Tax to AmountCounts tax towards the threshold.
Ship to Applicable / Specific CountriesHides the indicator for carts shipping elsewhere.

Then set features.freeShipping to true in magenx.config.ts.

Free shipping from a coupon or promotion stays a cart price rule. The indicator only shows its effect.

When the free rate is offered at checkout, the storefront selects it in advance.

Set up

  1. The merchant switches the free method on and enters a threshold for a website.
  2. The merchant chooses whether tax counts towards the threshold.
  3. The storefront's status read returns the new threshold; no storefront release is needed.

Browse without a cart

  1. A shopper with an empty cart opens a product page.
  2. The storefront shows "free shipping from" the threshold in the display currency.

Build the cart

  1. The shopper adds an item; the storefront re-reads the status.
  2. It shows the remaining amount and a progress bar.
  3. Once the cart qualifies, it shows the "unlocked" state.
  4. Removing items or a discount that drops the qualifying value below the threshold returns it to the remaining state.

Checkout

  1. The shopper enters an address; the shipping methods include the free method at 0.00 when the cart qualifies.
  2. The storefront pre-selects the free method unless the shopper already chose another method that is still offered.
  3. The order is placed with zero shipping.

These always hold:

  • When the status says a cart qualifies on value, the free method is offered for that cart at checkout (destination permitting).
  • When the status says a cart does not qualify, the free method is not offered on value.
  • The storefront never computes the threshold or remaining itself.
  • Qualifying value = physical items' subtotal after discounts, plus tax when tax inclusion is on.
  • Remaining = max(0, threshold − qualifying value), computed in base currency, then converted.
  • Qualifies = qualifying value ≥ threshold, or a promotion grants free shipping.
  • A changed threshold shows on the storefront within one cache lifetime of the change, with no storefront release.
SituationWhat happens
Qualifying value exactly equals the threshold.Qualifies; remaining 0.
Threshold is zero or empty.Threshold 0; qualifies true; storefront hides the progress indicator.
Discount pushes the value below the threshold.Not qualifying; remaining reflects the discounted value.
Display currency differs from base currency.Threshold and remaining converted; comparison made in base currency.
Unknown, inactive or another shopper's cart.Treated as no cart (threshold only); nothing about that cart revealed.
Virtual cart.Nothing returned.
Destination outside the free method's allowed countries.Nothing returned.
Free method off.Nothing returned; storefront hides the indicator.
Promotion grants free shipping below the threshold.Qualifies true; remaining still shows the gap to the threshold.
  • Guests and customers; physical carts; store views whose website has the free method on.
  • Thresholds per customer group, per product or per destination country.
  • Free shipping from promotions or coupons (an existing promotions feature already does this; this module only reports its effect).
  • Hiding paid shipping methods when the free one applies.
  • Showing the promise on product lists.
Terminal window
composer require magenxcommerce/module-free-shipping-graph-ql
bin/magento module:enable Magenx_FreeShippingGraphQl
bin/magento setup:upgrade
bin/magento setup:di:compile # production mode only
bin/magento cache:flush
  • PHP ~8.4.0||~8.5.0, Magento 2.4.8.

freeShipping needs no sign-in and changes nothing. An unknown or someone else’s cart is answered as if no cart was passed: you get the threshold, and nothing about that cart.

Queries

freeShipping(cart_id: String): FreeShippingStatus

The free-shipping threshold and, for a cart, how far it is from qualifying. Driven by the Free Shipping carrier settings (Stores → Configuration → Sales → Delivery Methods → Free Shipping), with the same rule the carrier uses to decide whether it is offered. Null when the carrier is disabled, the cart is virtual, or the cart's destination country is not served by the carrier. Never cached: the answer is private to the signed-in customer.

ArgumentTypeDescription
cart_idStringThe masked cart id. Optional: without it (or for a cart the caller cannot read) only the threshold is returned.

Types

type FreeShippingStatus - Where a cart stands against the free-shipping threshold. Amounts are in the cart's currency, or the store's display currency without a cart.
FieldTypeDescription
thresholdMoney!The order value that unlocks free shipping. 0 means every order ships free.
remainingMoneyHow much more the cart needs to reach the threshold, never below 0. Null without a cart.
qualifiesBoolean!Whether the cart reaches the threshold, or a cart price rule already grants it free shipping. Always false without a cart unless the threshold is 0.
TermMeaning
Free methodThe zero-cost shipping method offered when a cart qualifies.
ThresholdThe cart value at or above which the free method is offered. Zero means every cart qualifies.
Qualifying valueThe cart value compared with the threshold: physical items after discounts, with tax added only when the merchant chooses so.
RemainingThreshold minus qualifying value, never below zero.
QualifiesThe cart's qualifying value reaches the threshold, or a promotion already grants it free shipping.
StatusThreshold, remaining and qualifies, together.
Display currencyThe currency the shopper browses in; the threshold is configured in the store's base currency.