Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Promotions are applied randomly to line items #11725

Open
opeah opened this issue Mar 4, 2025 · 0 comments
Open

[Bug]: Promotions are applied randomly to line items #11725

opeah opened this issue Mar 4, 2025 · 0 comments

Comments

@opeah
Copy link

opeah commented Mar 4, 2025

Package.json file

{
  "name": "@nexa/medusa",
  "version": "1.0.0",
  "scripts": {
    "build": "npx medusa build",
    "dev": "npx medusa develop",
    "predeploy": "npx medusa db:migrate",
    "seed": "npx medusa exec ./src/scripts/seed-layouts.ts && npx medusa exec ./src/scripts/seed-pages.ts && npx medusa exec ./src/scripts/seed-theme.ts",
    "start": "pnpm run predeploy && pnpm run seed && cd .medusa/server && npx medusa start -H 0.0.0.0"
  },
  "dependencies": {
    "@aws-sdk/client-s3": "3.556.0",
    "@dnd-kit/core": "6.2.0",
    "@dnd-kit/sortable": "9.0.0",
    "@dnd-kit/utilities": "3.2.2",
    "@lexical/html": "0.20.0",
    "@lexical/list": "0.20.0",
    "@lexical/react": "0.20.0",
    "@lexical/utils": "0.20.0",
    "@medusa/mappers": "workspace:^",
    "@medusa/models": "workspace:^",
    "@medusa/operations": "workspace:^",
    "@medusajs/admin-sdk": "catalog:medusa",
    "@medusajs/cli": "catalog:medusa",
    "@medusajs/framework": "catalog:medusa",
    "@medusajs/icons": "catalog:medusa",
    "@medusajs/medusa": "catalog:medusa",
    "@medusajs/ui": "catalog:medusa",
    "@mikro-orm/cli": "6.4.3",
    "@mikro-orm/core": "6.4.3",
    "@mikro-orm/knex": "6.4.3",
    "@mikro-orm/migrations": "6.4.3",
    "@mikro-orm/postgresql": "6.4.3",
    "@nebula/modules": "workspace:^",
    "@nexa/analytics": "workspace:^",
    "@nexa/domain": "workspace:^",
    "@nexa/http-client": "workspace:^",
    "@nexa/utils": "workspace:^",
    "@slack/types": "2.14.0",
    "@slack/web-api": "7.8.0",
    "@types/facebook-nodejs-business-sdk": "catalog:",
    "attr-accept": "2.2.2",
    "awilix": "8.0.1",
    "cheerio": "1.0.0",
    "class-variance-authority": "catalog:",
    "color": "4.2.3",
    "customerio-node": "4.1.1",
    "facebook-nodejs-business-sdk": "catalog:",
    "fast-csv": "5.0.2",
    "ffmpeg-static": "5.2.0",
    "ffprobe-static": "3.1.0",
    "fluent-ffmpeg": "2.1.3",
    "lexical": "0.20.0",
    "lodash": "4.17.21",
    "lucide-react": "0.446.0",
    "motion": "catalog:",
    "multer": "1.4.5-lts.1",
    "pg": "8.13.0",
    "react-colorful": "5.6.1",
    "react-dropzone": "14.2.9",
    "react-easy-crop": "5.4.1",
    "react-hook-form": "catalog:",
    "react-image-crop": "11.0.7",
    "resend": "4.1.2",
    "sharp": "0.33.5",
    "slugify": "1.6.6",
    "stripe": "catalog:",
    "svgo": "3.3.2",
    "uuid": "catalog:",
    "zod": "catalog:"
  },
  "devDependencies": {
    "@swc/core": "1.7.28",
    "@swc/jest": "0.2.36",
    "@tanstack/react-query": "catalog:",
    "@tanstack/react-query-devtools": "catalog:",
    "@types/color": "4.2.0",
    "@types/ffprobe-static": "2.0.3",
    "@types/fluent-ffmpeg": "2.1.27",
    "@types/jest": "29.5.12",
    "@types/lodash": "4.17.10",
    "@types/multer": "1.4.12",
    "@types/node": "catalog:",
    "@types/react": "catalog:",
    "@types/react-dom": "catalog:",
    "@types/uuid": "catalog:",
    "jest": "29.7.0",
    "react": "catalog:",
    "react-dom": "catalog:",
    "react-router-dom": "6.20.1",
    "ts-node": "10.9.2",
    "typescript": "catalog:",
    "vite": "5.4.14"
  }
}

Node.js version

v22

Database and its version

16

Operating system name and version

MacOS

Browser name

Arc

What happended?

In the case of a ⁠buyxgety promotion, the promotion is applied randomly to line items.

As illustrated below:
Image
The promotion is applied to the first line, indicated by the presence of an adjustment.

When I increase the quantity, whether on the first line (with the promotion) or the second line, the promotion shifts to the second line.
Image

Expected behavior

The adjustment should remain on the same line. For instance, if it’s a gift or a promotion and I have an adjustment, I would like to hide the quantity selector. This is because I don't want customers to be able to increase the quantity. Additionally, having the promo badge moving is weird.

Actual behavior

When the customer increases the quantity, the adjustment shifts to another line.

Link to reproduction repo

https://github.com/medusajs/medusa-starter-default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant