Order Approval

mageb2b/sublogin-orderapproval lets a sublogin place an order that waits for a decision before normal processing continues. Approval can go directly to the main customer or, with the Role add-on, through parent groups first.

The package supports one subtotal threshold per sublogin. It is not a general workflow builder with separate manager, director and finance thresholds.

Install

composer require mageb2b/sublogin-orderapproval
php bin/magento module:enable MageB2B_SubloginOrderApproval
php bin/magento setup:upgrade

Role is optional. Install mageb2b/sublogin-role only when you need group-based routing or reusable approval permissions.

Decide when a buyer needs approval

Edit the sublogin and configure:

  • Order needs approval: enables approval for this buyer;
  • Order approval amount check: subtotal threshold.

A threshold of 0 sends every applicable order for approval. A positive threshold sends the order for approval when its subtotal exceeds that amount.

Order approval enabled for a sublogin with a subtotal threshold

Test tax, discounts and shipping separately. The trigger uses subtotal, not the Budget add-on's configurable calculation basis.

Direct approval without Role

When Role is not installed:

  1. the sublogin completes checkout;
  2. the order enters the configured approval state and status;
  3. the normal Magento order confirmation is held back;
  4. the main customer reviews the order;
  5. approve moves it to the configured approved state, while decline moves it to the configured decline state;
  6. final approval releases the normal order confirmation to the configured recipient.

The default final confirmation recipient is the sublogin.

Group approval with Role

When Role is active and Final Approve/Decline order when all group approved an order is enabled:

  1. the order enters the pre-approval state;
  2. eligible users in a parent group use the contributed approve or decline permission;
  3. approval advances through the configured group hierarchy;
  4. after group approval is complete, the main customer makes the final decision.

Can decline preapproval orders decides whether a group approver may decline before the order reaches final approval.

The hierarchy follows group parent relationships. There are no amount-specific group levels in this package.

Configure states and statuses

Open Stores > Configuration > MageB2B > Sublogin > Order approval settings.

Stage Default state/status Use
Pre-approval pre_approval Intermediate group decision when Role hierarchy is used.
Approval approval Waiting for the main customer's final decision.
Approved approved Final approval completed.
Declined not_approved Order was rejected.

The selected status must belong to the selected state in Magento. Test invoicing, shipment, payment capture and external exports with these custom states before launch.

Cart notice and deletion

Order Approval Notice appears in cart and checkout. Leaving it blank hides the notice but does not disable approval.

Delete not approved orders allows the main customer to delete an order that was not approved. Keep it disabled when your audit or accounting process requires declined orders to remain visible.

On massaction check approval state restricts the Admin mass action to orders currently in the approval state. It is enabled by default.

Edit an order awaiting approval

Enable Can Edit Order In Approval State when the main customer may revise a pending order. The edit flow rebuilds order details from a quote and can change items, addresses and payment data while keeping the order identity.

This is a high-impact action. Test tax, discounts, inventory, payment integrations and exports before enabling it.

Auto approve edited order moves an edited approval order directly to approved after the main account finishes editing. It is disabled by default. Keep it off when the changed order needs a separate final review.

Comments

Enable comments for selects which actions request a comment, such as edit, approve or decline. Separate settings control whether decline and edit comments are visible in the storefront.

Use comments for a useful purchasing reason, not sensitive personal data. Buyers and approvers may see the text according to configuration.

Email flow

The module provides templates for:

  • approval required;
  • next group approval level;
  • approved and declined decisions;
  • main-account order alert;
  • edited order;
  • deleted order.

Recipient settings can include the main customer and sublogin. The normal Magento order confirmation is delayed until final approval, then sent to the configured final recipient list.

Approval links use internal order tokens. Do not place token values in screenshots, tickets or logs.

Budget interaction

With Budget installed, an over-budget cart is normally blocked. Allow budget restricted order to checkout can instead create it in the approval state. For this case, Budget's restriction drives approval and the sublogin's normal approval threshold is ignored.

Test these cases separately:

  1. within budget and below approval threshold;
  2. within budget and above approval threshold;
  3. over budget with approval fallback enabled;
  4. no applicable budget with the empty-budget option enabled or disabled.

A complete staging test

  1. Create one sublogin whose threshold is easy to cross.
  2. Place an order below the threshold and confirm it follows normal processing.
  3. Place an order above the threshold.
  4. Confirm the approval notice, state and email recipient.
  5. Approve it from the main account and verify final confirmation.
  6. Place another order and decline it with a comment.
  7. If Role is installed, repeat with a child and parent group.
  8. If editing is enabled, change an item and address before final approval.

Hyvä storefront

Install mageb2b/sublogin-orderapproval-hyva together with the base Sublogin Hyvä bridge. See Hyvä Compatibility Packages.

Troubleshooting

  • Order skipped approval: check the module switch, sublogin flag and whether subtotal actually exceeded the threshold.
  • No group approver appears: check Role activation, group parents and approve/decline permission.
  • Order never reaches the main customer: inspect the group chain and pre-approval state.
  • Confirmation sent too early or to the wrong party: review Order Approval recipient settings and test the final decision path.
  • Admin mass action changes nothing: confirm the order is in the configured approval state when state checking is enabled.

Related: Roles, Permissions and Groups, Budget Management, and Permission Problems.