Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Never create adjustments with a zero amount #69

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 2, 2023

The specs here are a bit contrived, as it's unlikely for a calculator to have a zero percentage. However, the scenario is quite real: In shops that don't select a shipping rate automatically in the delivery step of checkout, the shipment's cost will be zero until the customer has selected a shipping rate. At this point the promotion system will happily add discounts with no amount.

The specs here are a bit contrived, as it's unlikely for a calculator to
have a zero percentage. However, the scenario is quite real: In shops
that don't select a shipping rate automatically in the delivery step of
checkout, the shipment's cost will be zero until the customer has
selected a shipping rate. At this point the promotion system will
happily add discounts with no amount.
Rather than selecting senseless discounts out in the order discounter,
we can already tell the action to never create the discount in the first
place.
@mamhoff mamhoff force-pushed the never-create-zero-adjustments branch from 1288d14 to e4c1a62 Compare November 2, 2023 12:14
Copy link
Collaborator

@davecandlescience davecandlescience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@mamhoff mamhoff merged commit 13df021 into main Nov 2, 2023
@mamhoff mamhoff deleted the never-create-zero-adjustments branch November 2, 2023 14:37
mamhoff added a commit that referenced this pull request Jul 1, 2024
Never create adjustments with a zero amount
mamhoff added a commit that referenced this pull request Oct 25, 2024
Never create adjustments with a zero amount
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants