Skip to content

[BUG] Discount coupons with more than 100% discount of entire order value #88

@wojtek777

Description

@wojtek777

Describe the bug
When adding coupons in admin panel, it is possible to insert and enable the coupon that has more than 100% discount of whole order value, resulting in shop 'paying the customer for their purchase'.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'admin' panel
  2. Click on 'coupons' under 'promotion'
  3. Click on the green 'New coupon' button
  4. In the window that appears, insert more than 100 units value in the 'Discount amount' box
  5. In the 'Discount Type' selective menu, select 'percentage discount to entire order'
  6. Coupon is added and active to use

Expected behavior
When selecting 'percentage discount to entire order', a limit on the page should be set to deny adding coupons with more
then 100% discount percentage rate

Screenshots
higher1
higher2

Background (please complete the following information):

  • NodeJS 20.10.0
  • Postgres 13.12
  • ShopMost 1.0.1
  • OS: Fedora
  • Browser: Mozilla Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions