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]: Select shipping option errors when checkout an item has many variants #10735

Open
helloquang opened this issue Dec 25, 2024 · 16 comments
Open

Comments

@helloquang
Copy link

helloquang commented Dec 25, 2024

Package.json file

{
  "name": "medusa-starter-default",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "2.1.3",
    "@medusajs/cache-redis": "^2.1.3",
    "@medusajs/cli": "2.1.3",
    "@medusajs/event-bus-redis": "^2.1.3",
    "@medusajs/file": "^2.1.3",
    "@medusajs/file-s3": "^2.1.3",
    "@medusajs/framework": "2.1.3",
    "@medusajs/medusa": "2.1.3",
    "@mikro-orm/core": "5.9.7",
    "@mikro-orm/knex": "5.9.7",
    "@mikro-orm/migrations": "5.9.7",
    "@mikro-orm/postgresql": "5.9.7",
    "@rokmohar/medusa-plugin-meilisearch": "^0.1.5",
    "awilix": "^8.0.1",
    "pg": "^8.13.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "2.1.3",
    "@mikro-orm/cli": "5.9.7",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v20

Database and its version

Postgres 17

Operating system name and version

Debian 12

Browser name

No response

What happended?

POST Request to endpoint: store/carts/{cart_id}/shipping-methods
I can select shipping option when a product has 1 variant.

When a product has 2 or more variants , the database will throw error

2024-12-25 16:15:55.087 UTC [839] ERROR: operator does not exist: text = record at character 6844
2024-12-25 16:15:55.087 UTC [839] HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
2024-12-25 16:15:55.087 UTC [839] STATEMENT: select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and ("pr"."operator" = $9 and $10 >= pr.value::numeric) or ("pr"."operator" = $11 and $12 > pr.value::numeric) or ("pr"."operator" = $13 and $14 < pr.value::numeric) or ("pr"."operator" = $15 and $16 <= pr.value::numeric) or ("pr"."operator" = $17 and $18 = pr.value::numeric)) or ("pr"."attribute" = $19 and ("pr"."operator" = $20 and $21 >= pr.value::numeric) or ("pr"."operator" = $22 and $23 > pr.value::numeric) or ("pr"."operator" = $24 and $25 < pr.value::numeric) or ("pr"."operator" = $26 and $27 <= pr.value::numeric) or ("pr"."operator" = $28 and $29 = pr.value::numeric)) or ("pr"."attribute" = $30 and "pr"."value" in ($31)) or ("pr"."attribute" = $32 and "pr"."value" in ($33)) or ("pr"."attribute" = $34 and "pr"."value" in ($35)) or ("pr"."attribute" = $36 and "pr"."value" in ($37)) or ("pr"."attribute" = $38 and "pr"."value" in ($39)) or ("pr"."attribute" = $40 and "pr"."value" in ($41)) or ("pr"."attribute" = $42 and "pr"."value" in ($43, $44, $45)) or ("pr"."attribute" = $46 and "pr"."value" in ($47, $48, $49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51, $52, $53)) or ("pr"."attribute" = $54 and "pr"."value" in ($55, $56, $57)) or ("pr"."attribute" = $58 and "pr"."value" in ($59, $60, $61)) or ("pr"."attribute" = $62 and "pr"."value" in ($63, $64, $65)) or ("pr"."attribute" = $66 and "pr"."value" in ($67, $68, $69)) or ("pr"."attribute" = $70 and "pr"."value" in ($71, $72, $73)) or ("pr"."attribute" = $74 and "pr"."value" in ($75, $76, $77)) or ("pr"."attribute" = $78 and "pr"."value" in ($79, $80, $81)) or ("pr"."attribute" = $82 and "pr"."value" in ($83, $84, $85)) or ("pr"."attribute" = $86 and "pr"."value" in ($87, $88, $89)) or ("pr"."attribute" = $90 and "pr"."value" in ($91, $92, $93)) or ("pr"."attribute" = $94 and "pr"."value" in ($95, $96, $97)) or ("pr"."attribute" = $98 and "pr"."value" in ($99, $100, $101)) or ("pr"."attribute" = $102 and "pr"."value" in ($103, $104, $105)) or ("pr"."attribute" = $106 and "pr"."value" in ($107, $108, $109)) or ("pr"."attribute" = $110 and "pr"."value" in ($111, $112, $113)) or ("pr"."attribute" = $114 and "pr"."value" in ($115, $116, $117)) or ("pr"."attribute" = $118 and "pr"."value" in ($119, $120, $121)) or ("pr"."attribute" = $122 and "pr"."value" in ($123, $124, $125)) or ("pr"."attribute" = $126 and "pr"."value" in ($127, $128, $129)) or ("pr"."attribute" = $130 and "pr"."value" in ($131, $132, $133)) or ("pr"."attribute" = $134 and "pr"."value" in ($135, $136, $137)) or ("pr"."attribute" = $138 and "pr"."value" in ($139, $140, $141)) or ("pr"."attribute" = $142 and "pr"."value" in ($143, $144, $145)) or ("pr"."attribute" = $146 and "pr"."value" in ($147, $148, $149)) or ("pr"."attribute" = $150 and "pr"."value" in ($151, $152, $153)) or ("pr"."attribute" = $154 and "pr"."value" in ($155, $156, $157)) or ("pr"."attribute" = $158 and "pr"."value" in ($159, $160, $161)) or ("pr"."attribute" = $162 and "pr"."value" in ($163, $164, $165)) or ("pr"."attribute" = $166 and "pr"."value" in ($167, $168, $169)) or ("pr"."attribute" = $170 and "pr"."value" in ($171, $172, $173)) or ("pr"."attribute" = $174 and "pr"."value" in ($175, $176, $177)) or ("pr"."attribute" = $178 and "pr"."value" in ($179, $180, $181)) or ("pr"."attribute" = $182 and "pr"."value" in ($183, $184, $185)) or ("pr"."attribute" = $186 and "pr"."value" in ($187, $188, $189)) or ("pr"."attribute" = $190 and "pr"."value" in ($191, $192, $193)) or ("pr"."attribute" = $194 and "pr"."value" in ($195, $196, $197)) or ("pr"."attribute" = $198 and "pr"."value" in ($199, $200, $201)) or ("pr"."attribute" = $202 and "pr"."value" in ($203, $204, $205)) or ("pr"."attribute" = $206 and "pr"."value" in ($207, $208, $209)) or ("pr"."attribute" = $210 and "pr"."value" in ($211, $212, $213)) or ("pr"."attribute" = $214 and "pr"."value" in ($215, $216, $217)) or ("pr"."attribute" = $218 and "pr"."value" in ($219, $220, $221)) or ("pr"."attribute" = $222 and "pr"."value" in ($223, $224, $225)) or ("pr"."attribute" = $226 and "pr"."value" in ($227, $228, $229)) or ("pr"."attribute" = $230 and "pr"."value" in ($231, $232, $233)) or ("pr"."attribute" = $234 and "pr"."value" in ($235, $236, $237)) or ("pr"."attribute" = $238 and "pr"."value" in ($239, $240, $241)) or ("pr"."attribute" = $242 and "pr"."value" in ($243, $244, $245)) or ("pr"."attribute" = $246 and "pr"."value" in ($247, $248, $249)) or ("pr"."attribute" = $250 and "pr"."value" in ($251, $252, $253)) or ("pr"."attribute" = $254 and "pr"."value" in ($255, $256, $257)) or ("pr"."attribute" = $258 and "pr"."value" in ($259, $260, $261)) or ("pr"."attribute" = $262 and "pr"."value" in ($263, $264, $265)) or ("pr"."attribute" = $266 and "pr"."value" in ($267, $268, $269)) or ("pr"."attribute" = $270 and "pr"."value" in ($271, $272, $273)) or ("pr"."attribute" = $274 and "pr"."value" in ($275, $276, $277)) or ("pr"."attribute" = $278 and "pr"."value" in ($279, $280, $281)) or ("pr"."attribute" = $282 and "pr"."value" in ($283, $284, $285)) or ("pr"."attribute" = $286 and "pr"."value" in ($287, $288, $289)) or ("pr"."attribute" = $290 and "pr"."value" in ($291, $292, $293)) or ("pr"."attribute" = $294 and "pr"."value" in ($295, $296, $297)) or ("pr"."attribute" = $298 and "pr"."value" in ($299, $300, $301)) or ("pr"."attribute" = $302 and "pr"."value" in (($303), ($304), ($305, $306))) or "price"."rules_count" = $307)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $308) and "plr"."value" @> $309 or ("plr"."attribute" = $310) and "plr"."value" @> $311 or ("plr"."attribute" = $312) and "plr"."value" @> $313 or ("plr"."attribute" = $314) and "plr"."value" @> $315 or ("plr"."attribute" = $316) and "plr"."value" @> $317 or ("plr"."attribute" = $318) and "plr"."value" @> $319 or ("plr"."attribute" = $320) and "plr"."value" @> $321 or ("plr"."attribute" = $322) and "plr"."value" @> $323 or ("plr"."attribute" = $324) and "plr"."value" @> $325 or ("plr"."attribute" = $326) and "plr"."value" @> $327 or ("plr"."attribute" = $328) and "plr"."value" @> $329 or ("plr"."attribute" = $330) and "plr"."value" @> $331 or ("plr"."attribute" = $332) and "plr"."value" @> $333 or ("plr"."attribute" = $334) and "plr"."value" @> $335 or ("plr"."attribute" = $336) and "plr"."value" @> $337 or ("plr"."attribute" = $338) and "plr"."value" @> $339 or ("plr"."attribute" = $340) and "plr"."value" @> $341 or ("plr"."attribute" = $342) and "plr"."value" @> $343 or ("plr"."attribute" = $344) and "plr"."value" @> $345 or ("plr"."attribute" = $346) and "plr"."value" @> $347 or ("plr"."attribute" = $348) and "plr"."value" @> $349 or ("plr"."attribute" = $350) and "plr"."value" @> $351 or ("plr"."attribute" = $352) and "plr"."value" @> $353 or ("plr"."attribute" = $354) and "plr"."value" @> $355 or ("plr"."attribute" = $356) and "plr"."value" @> $357 or ("plr"."attribute" = $358) and "plr"."value" @> $359 or ("plr"."attribute" = $360) and "plr"."value" @> $361 or ("plr"."attribute" = $362) and "plr"."value" @> $363 or ("plr"."attribute" = $364) and "plr"."value" @> $365 or ("plr"."attribute" = $366) and "plr"."value" @> $367 or ("plr"."attribute" = $368) and "plr"."value" @> $369 or ("plr"."attribute" = $370) and "plr"."value" @> $371 or ("plr"."attribute" = $372) and "plr"."value" @> $373 or ("plr"."attribute" = $374) and "plr"."value" @> $375 or ("plr"."attribute" = $376) and "plr"."value" @> $377 or ("plr"."attribute" = $378) and "plr"."value" @> $379 or ("plr"."attribute" = $380) and "plr"."value" @> $381 or ("plr"."attribute" = $382) and "plr"."value" @> $383 or ("plr"."attribute" = $384) and "plr"."value" @> $385 or ("plr"."attribute" = $386) and "plr"."value" @> $387 or ("plr"."attribute" = $388) and "plr"."value" @> $389 or ("plr"."attribute" = $390) and "plr"."value" @> $391 or ("plr"."attribute" = $392) and "plr"."value" @> $393 or ("plr"."attribute" = $394) and "plr"."value" @> $395 or ("plr"."attribute" = $396) and "plr"."value" @> $397 or ("plr"."attribute" = $398) and "plr"."value" @> $399 or ("plr"."attribute" = $400) and "plr"."value" @> $401 or ("plr"."attribute" = $402) and "plr"."value" @> $403 or ("plr"."attribute" = $404) and "plr"."value" @> $405 or ("plr"."attribute" = $406) and "plr"."value" @> $407 or ("plr"."attribute" = $408) and "plr"."value" @> $409 or ("plr"."attribute" = $410) and "plr"."value" @> $411 or ("plr"."attribute" = $412) and "plr"."value" @> $413 or ("plr"."attribute" = $414) and "plr"."value" @> $415 or ("plr"."attribute" = $416) and "plr"."value" @> $417 or ("plr"."attribute" = $418) and "plr"."value" @> $419 or ("plr"."attribute" = $420) and "plr"."value" @> $421 or ("plr"."attribute" = $422) and "plr"."value" @> $423 or ("plr"."attribute" = $424) and "plr"."value" @> $425 or ("plr"."attribute" = $426) and "plr"."value" @> $427 or ("plr"."attribute" = $428) and "plr"."value" @> $429 or ("plr"."attribute" = $430) and "plr"."value" @> $431 or ("plr"."attribute" = $432) and "plr"."value" @> $433 or ("plr"."attribute" = $434) and "plr"."value" @> $435 or ("plr"."attribute" = $436) and "plr"."value" @> $437 or ("plr"."attribute" = $438) and "plr"."value" @> $439 or ("plr"."attribute" = $440) and "plr"."value" @> $441 or ("plr"."attribute" = $442) and "plr"."value" @> $443 or ("plr"."attribute" = $444) and "plr"."value" @> $445 or ("plr"."attribute" = $446) and "plr"."value" @> $447 or ("plr"."attribute" = $448) and "plr"."value" @> $449 or ("plr"."attribute" = $450) and "plr"."value" @> $451 or ("plr"."attribute" = $452) and "plr"."value" @> $453 or ("plr"."attribute" = $454) and "plr"."value" @> $455 or ("plr"."attribute" = $456) and "plr"."value" @> $457 or ("plr"."attribute" = $458) and "plr"."value" @> $459 or ("plr"."attribute" = $460) and "plr"."value" @> $461 or "pl"."rules_count" = $462) and ((("pr"."attribute" = $463 and "pr"."value" in ($464)) or ("pr"."attribute" = $465 and "pr"."value" in ($466)) or ("pr"."attribute" = $467 and "pr"."value" in ($468)) or ("pr"."attribute" = $469 and ("pr"."operator" = $470 and $471 >= pr.value::numeric) or ("pr"."operator" = $472 and $473 > pr.value::numeric) or ("pr"."operator" = $474 and $475 < pr.value::numeric) or ("pr"."operator" = $476 and $477 <= pr.value::numeric) or ("pr"."operator" = $478 and $479 = pr.value::numeric)) or ("pr"."attribute" = $480 and ("pr"."operator" = $481 and $482 >= pr.value::numeric) or ("pr"."operator" = $483 and $484 > pr.value::numeric) or ("pr"."operator" = $485 and $486 < pr.value::numeric) or ("pr"."operator" = $487 and $488 <= pr.value::numeric) or ("pr"."operator" = $489 and $490 = pr.value::numeric)) or ("pr"."attribute" = $491 and "pr"."value" in ($492)) or ("pr"."attribute" = $493 and "pr"."value" in ($494)) or ("pr"."attribute" = $495 and "pr"."value" in ($496)) or ("pr"."attribute" = $497 and "pr"."value" in ($498)) or ("pr"."attribute" = $499 and "pr"."value" in ($500)) or ("pr"."attribute" = $501 and "pr"."value" in ($502)) or ("pr"."attribute" = $503 and "pr"."value" in ($504, $505, $506)) or ("pr"."attribute" = $507 and "pr"."value" in ($508, $509, $510)) or ("pr"."attribute" = $511 and "pr"."value" in ($512, $513, $514)) or ("pr"."attribute" = $515 and "pr"."value" in ($516, $517, $518)) or ("pr"."attribute" = $519 and "pr"."value" in ($520, $521, $522)) or ("pr"."attribute" = $523 and "pr"."value" in ($524, $525, $526)) or ("pr"."attribute" = $527 and "pr"."value" in ($528, $529, $530)) or ("pr"."attribute" = $531 and "pr"."value" in ($532, $533, $534)) or ("pr"."attribute" = $535 and "pr"."value" in ($536, $537, $538)) or ("pr"."attribute" = $539 and "pr"."value" in ($540, $541, $542)) or ("pr"."attribute" = $543 and "pr"."value" in ($544, $545, $546)) or ("pr"."attribute" = $547 and "pr"."value" in ($548, $549, $550)) or ("pr"."attribute" = $551 and "pr"."value" in ($552, $553, $554)) or ("pr"."attribute" = $555 and "pr"."value" in ($556, $557, $558)) or ("pr"."attribute" = $559 and "pr"."value" in ($560, $561, $562)) or ("pr"."attribute" = $563 and "pr"."value" in ($564, $565, $566)) or ("pr"."attribute" = $567 and "pr"."value" in ($568, $569, $570)) or ("pr"."attribute" = $571 and "pr"."value" in ($572, $573, $574)) or ("pr"."attribute" = $575 and "pr"."value" in ($576, $577, $578)) or ("pr"."attribute" = $579 and "pr"."value" in ($580, $581, $582)) or ("pr"."attribute" = $583 and "pr"."value" in ($584, $585, $586)) or ("pr"."attribute" = $587 and "pr"."value" in ($588, $589, $590)) or ("pr"."attribute" = $591 and "pr"."value" in ($592, $593, $594)) or ("pr"."attribute" = $595 and "pr"."value" in ($596, $597, $598)) or ("pr"."attribute" = $599 and "pr"."value" in ($600, $601, $602)) or ("pr"."attribute" = $603 and "pr"."value" in ($604, $605, $606)) or ("pr"."attribute" = $607 and "pr"."value" in ($608, $609, $610)) or ("pr"."attribute" = $611 and "pr"."value" in ($612, $613, $614)) or ("pr"."attribute" = $615 and "pr"."value" in ($616, $617, $618)) or ("pr"."attribute" = $619 and "pr"."value" in ($620, $621, $622)) or ("pr"."attribute" = $623 and "pr"."value" in ($624, $625, $626)) or ("pr"."attribute" = $627 and "pr"."value" in ($628, $629, $630)) or ("pr"."attribute" = $631 and "pr"."value" in ($632, $633, $634)) or ("pr"."attribute" = $635 and "pr"."value" in ($636, $637, $638)) or ("pr"."attribute" = $639 and "pr"."value" in ($640, $641, $642)) or ("pr"."attribute" = $643 and "pr"."value" in ($644, $645, $646)) or ("pr"."attribute" = $647 and "pr"."value" in ($648, $649, $650)) or ("pr"."attribute" = $651 and "pr"."value" in ($652, $653, $654)) or ("pr"."attribute" = $655 and "pr"."value" in ($656, $657, $658)) or ("pr"."attribute" = $659 and "pr"."value" in ($660, $661, $662)) or ("pr"."attribute" = $663 and "pr"."value" in ($664, $665, $666)) or ("pr"."attribute" = $667 and "pr"."value" in ($668, $669, $670)) or ("pr"."attribute" = $671 and "pr"."value" in ($672, $673, $674)) or ("pr"."attribute" = $675 and "pr"."value" in ($676, $677, $678)) or ("pr"."attribute" = $679 and "pr"."value" in ($680, $681, $682)) or ("pr"."attribute" = $683 and "pr"."value" in ($684, $685, $686)) or ("pr"."attribute" = $687 and "pr"."value" in ($688, $689, $690)) or ("pr"."attribute" = $691 and "pr"."value" in ($692, $693, $694)) or ("pr"."attribute" = $695 and "pr"."value" in ($696, $697, $698)) or ("pr"."attribute" = $699 and "pr"."value" in ($700, $701, $702)) or ("pr"."attribute" = $703 and "pr"."value" in ($704, $705, $706)) or ("pr"."attribute" = $707 and "pr"."value" in ($708, $709, $710)) or ("pr"."attribute" = $711 and "pr"."value" in ($712, $713, $714)) or ("pr"."attribute" = $715 and "pr"."value" in ($716, $717, $718)) or ("pr"."attribute" = $719 and "pr"."value" in ($720, $721, $722)) or ("pr"."attribute" = $723 and "pr"."value" in ($724, $725, $726)) or ("pr"."attribute" = $727 and "pr"."value" in ($728, $729, $730)) or ("pr"."attribute" = $731 and "pr"."value" in ($732, $733, $734)) or ("pr"."attribute" = $735 and "pr"."value" in ($736, $737, $738)) or ("pr"."attribute" = $739 and "pr"."value" in ($740, $741, $742)) or ("pr"."attribute" = $743 and "pr"."value" in ($744, $745, $746)) or ("pr"."attribute" = $747 and "pr"."value" in ($748, $749, $750)) or ("pr"."attribute" = $751 and "pr"."value" in ($752, $753, $754)) or ("pr"."attribute" = $755 and "pr"."value" in ($756, $757, $758)) or ("pr"."attribute" = $759 and "pr"."value" in ($760, $761, $762)) or ("pr"."attribute" = $763 and "pr"."value" in (($764), ($765), ($766, $767))) and "price"."rules_count" > $768) or "price"."rules_count" = $769))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($770) and "price"."currency_code" = $771 and ("price"."min_quantity" <= $772 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc

Expected behavior

I can select shipping option with product has many variants

Actual behavior

Error when select shipping option with product has many variants

Link to reproduction repo

private

@jpmartinez-polstudios
Copy link

Having the same issue

@docloulou
Copy link
Contributor

On my side, this error occurs when I try to add an item to the cart after already selecting a shipping option.

@riqwan
Copy link
Contributor

riqwan commented Dec 27, 2024

Hey guys, can you provide steps to reproduce here including what your pricing and shipping options look like? I can't seem to reproduce this on the seed data

cc. @docloulou @jpmartinez-polstudios @helloquang

@SaintsPrinting
Copy link

I’m trying to explain the issue as best as I can – bear with me, as I’m not entirely sure what I’m dealing with here. This might be a different issue altogether, but it feels close enough to add to this thread.

Here's the situation:
I have a "FREE" shipping option that’s manually fulfilled. My pricing structure is simple – item variants with different pricing (some don’t vary). Everything worked fine until I integrated my TaxJar tax provider. TaxJar seems to calculate taxes correctly, but I encounter an error when adding an item to the cart under these conditions:

  • I have an existing account with my address saved.
  • Proceed through checkout (using the Next.js Medusa template) up to the payment step.

Disabling the tax provider temporarily resolves the issue, but I’m not convinced that’s the root cause—perhaps just a side effect. Let me know if you need more details.

@riqwan
Copy link
Contributor

riqwan commented Dec 27, 2024

Thanks @SaintsPrinting, since I can't integrate that right now, can you share the output of the following:

  1. Open the file on the backend server - node_modules/@medusajs/core-flows/dist/cart/steps/validate-shipping-methods-data.js
  2. Add a new line in line 17
  3. Add this - console.log("option - ", JSON.stringify(option, null, 4))

Here's a screenshot of what that should look like

Screenshot 2024-12-27 at 21 21 41

Make sure to send all the "option" outputs

@SaintsPrinting
Copy link

Hey @riqwan, I made that adjustment, but how do I get to the point where this will log out? I was able to replicate my issue and will print my logs out, which is slightly different than the issue here.

select "price"."id" as "id", "ps"."id" as "price_set_id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."rules_count" as "rules_count", "price"."pl_rules_count" as "pl_rules_count", "price"."pl_type" as "price_list_type", "price"."price_list_id" as "price_list_id", COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0) as "all_rules_count" from "price_set" as "ps" inner join (select "price"."id" as "id", "price"."amount" as "amount", "price"."raw_amount" as "raw_amount", "price"."min_quantity" as "min_quantity", "price"."max_quantity" as "max_quantity", "price"."currency_code" as "currency_code", "price"."price_set_id" as "price_set_id", "price"."rules_count" as "rules_count", "price"."price_list_id" as "price_list_id", "pl"."rules_count" as "pl_rules_count", "pl"."type" as "pl_type", case when price.price_list_id IS NULL then False else True end as "has_price_list" from "price" as "price" left join "price_rule" as "pr" on "pr"."price_id" = "price"."id" left join "price_list" as "pl" on "pl"."id" = "price"."price_list_id" and "pl"."status" = $1 left join "price_list_rule" as "plr" on "plr"."price_list_id" = "pl"."id" where ("price"."price_list_id" is null and (("pr"."attribute" = $2 and "pr"."value" in ($3)) or ("pr"."attribute" = $4 and "pr"."value" in ($5)) or ("pr"."attribute" = $6 and "pr"."value" in ($7)) or ("pr"."attribute" = $8 and ("pr"."operator" = $9 and $10 >= pr.value::numeric) or ("pr"."operator" = $11 and $12 > pr.value::numeric) or ("pr"."operator" = $13 and $14 < pr.value::numeric) or ("pr"."operator" = $15 and $16 <= pr.value::numeric) or ("pr"."operator" = $17 and $18 = pr.value::numeric)) or ("pr"."attribute" = $19 and ("pr"."operator" = $20 and $21 >= pr.value::numeric) or ("pr"."operator" = $22 and $23 > pr.value::numeric) or ("pr"."operator" = $24 and $25 < pr.value::numeric) or ("pr"."operator" = $26 and $27 <= pr.value::numeric) or ("pr"."operator" = $28 and $29 = pr.value::numeric)) or ("pr"."attribute" = $30 and "pr"."value" in ($31)) or ("pr"."attribute" = $32 and "pr"."value" in ($33)) or ("pr"."attribute" = $34 and "pr"."value" in ($35)) or ("pr"."attribute" = $36 and "pr"."value" in ($37)) or ("pr"."attribute" = $38 and "pr"."value" in ($39)) or ("pr"."attribute" = $40 and "pr"."value" in ($41)) or ("pr"."attribute" = $42 and "pr"."value" in ($43)) or ("pr"."attribute" = $44 and "pr"."value" in ($45)) or ("pr"."attribute" = $46 and "pr"."value" in ($47)) or ("pr"."attribute" = $48 and "pr"."value" in ($49)) or ("pr"."attribute" = $50 and "pr"."value" in ($51)) or ("pr"."attribute" = $52 and "pr"."value" in ($53, $54)) or ("pr"."attribute" = $55 and "pr"."value" in ($56, $57)) or ("pr"."attribute" = $58 and "pr"."value" in ($59, $60)) or ("pr"."attribute" = $61 and "pr"."value" in ($62, $63)) or ("pr"."attribute" = $64 and "pr"."value" in ($65, $66)) or ("pr"."attribute" = $67 and "pr"."value" in ($68, $69)) or ("pr"."attribute" = $70 and "pr"."value" in ($71, $72)) or ("pr"."attribute" = $73 and "pr"."value" in ($74, $75)) or ("pr"."attribute" = $76 and "pr"."value" in ($77, $78)) or ("pr"."attribute" = $79 and "pr"."value" in ($80, $81)) or ("pr"."attribute" = $82 and "pr"."value" in ($83, $84)) or ("pr"."attribute" = $85 and "pr"."value" in ($86, $87)) or ("pr"."attribute" = $88 and "pr"."value" in ($89, $90)) or ("pr"."attribute" = $91 and "pr"."value" in ($92, $93)) or ("pr"."attribute" = $94 and "pr"."value" in ($95, $96)) or ("pr"."attribute" = $97 and "pr"."value" in ($98, $99)) or ("pr"."attribute" = $100 and "pr"."value" in ($101, $102)) or ("pr"."attribute" = $103 and "pr"."value" in ($104, $105)) or ("pr"."attribute" = $106 and "pr"."value" in ($107, $108)) or ("pr"."attribute" = $109 and "pr"."value" in ($110, $111)) or ("pr"."attribute" = $112 and "pr"."value" in ($113, $114)) or ("pr"."attribute" = $115 and "pr"."value" in ($116, $117)) or ("pr"."attribute" = $118 and "pr"."value" in ($119, $120)) or ("pr"."attribute" = $121 and "pr"."value" in ($122, $123)) or ("pr"."attribute" = $124 and "pr"."value" in ($125, $126)) or ("pr"."attribute" = $127 and "pr"."value" in ($128, $129)) or ("pr"."attribute" = $130 and "pr"."value" in ($131, $132)) or ("pr"."attribute" = $133 and "pr"."value" in ($134, $135)) or ("pr"."attribute" = $136 and "pr"."value" in ($137, $138)) or ("pr"."attribute" = $139 and "pr"."value" in (($140), ())) or ("pr"."attribute" = $141 and "pr"."value" in ($142, $143)) or ("pr"."attribute" = $144 and "pr"."value" in ($145, $146)) or ("pr"."attribute" = $147 and "pr"."value" in ($148, $149)) or ("pr"."attribute" = $150 and "pr"."value" in ($151, $152)) or ("pr"."attribute" = $153 and "pr"."value" in ($154, $155)) or ("pr"."attribute" = $156 and "pr"."value" in ($157, $158)) or ("pr"."attribute" = $159 and "pr"."value" in ($160, $161)) or ("pr"."attribute" = $162 and "pr"."value" in ($163, $164)) or ("pr"."attribute" = $165 and "pr"."value" in ($166, $167)) or ("pr"."attribute" = $168 and "pr"."value" in ($169, $170)) or ("pr"."attribute" = $171 and "pr"."value" in ($172, $173)) or ("pr"."attribute" = $174 and "pr"."value" in ($175, $176)) or ("pr"."attribute" = $177 and "pr"."value" in ($178, $179)) or ("pr"."attribute" = $180 and "pr"."value" in ($181, $182)) or ("pr"."attribute" = $183 and "pr"."value" in ($184, $185)) or ("pr"."attribute" = $186 and "pr"."value" in ($187, $188)) or ("pr"."attribute" = $189 and "pr"."value" in ($190, $191)) or ("pr"."attribute" = $192 and "pr"."value" in ($193, $194)) or ("pr"."attribute" = $195 and "pr"."value" in ($196, $197)) or ("pr"."attribute" = $198 and "pr"."value" in ($199, $200)) or ("pr"."attribute" = $201 and "pr"."value" in ($202, $203)) or ("pr"."attribute" = $204 and "pr"."value" in ($205, $206)) or ("pr"."attribute" = $207 and "pr"."value" in ($208, $209)) or ("pr"."attribute" = $210 and "pr"."value" in ($211, $212)) or ("pr"."attribute" = $213 and "pr"."value" in ($214, $215)) or ("pr"."attribute" = $216 and "pr"."value" in ($217, $218)) or ("pr"."attribute" = $219 and "pr"."value" in ($220, $221)) or ("pr"."attribute" = $222 and "pr"."value" in ($223, $224)) or ("pr"."attribute" = $225 and "pr"."value" in ($226, $227)) or ("pr"."attribute" = $228 and "pr"."value" in ($229, $230)) or ("pr"."attribute" = $231 and "pr"."value" in ($232, $233)) or ("pr"."attribute" = $234 and "pr"."value" in ($235, $236)) or ("pr"."attribute" = $237 and "pr"."value" in ($238, $239)) or ("pr"."attribute" = $240 and "pr"."value" in ($241, $242)) or ("pr"."attribute" = $243 and "pr"."value" in ($244, $245)) or ("pr"."attribute" = $246 and "pr"."value" in ($247, $248)) or ("pr"."attribute" = $249 and "pr"."value" in (($250), ($251))) or "price"."rules_count" = $252)) or ("price"."price_list_id" is not null and "pl"."deleted_at" is null and ("pl"."starts_at" is null or "pl"."starts_at" <= CURRENT_TIMESTAMP) and ("pl"."ends_at" is null or "pl"."ends_at" >= CURRENT_TIMESTAMP) and ((("plr"."attribute" = $253) and "plr"."value" @> $254 or ("plr"."attribute" = $255) and "plr"."value" @> $256 or ("plr"."attribute" = $257) and "plr"."value" @> $258 or ("plr"."attribute" = $259) and "plr"."value" @> $260 or ("plr"."attribute" = $261) and "plr"."value" @> $262 or ("plr"."attribute" = $263) and "plr"."value" @> $264 or ("plr"."attribute" = $265) and "plr"."value" @> $266 or ("plr"."attribute" = $267) and "plr"."value" @> $268 or ("plr"."attribute" = $269) and "plr"."value" @> $270 or ("plr"."attribute" = $271) and "plr"."value" @> $272 or ("plr"."attribute" = $273) and "plr"."value" @> $274 or ("plr"."attribute" = $275) and "plr"."value" @> $276 or ("plr"."attribute" = $277) and "plr"."value" @> $278 or ("plr"."attribute" = $279) and "plr"."value" @> $280 or ("plr"."attribute" = $281) and "plr"."value" @> $282 or ("plr"."attribute" = $283) and "plr"."value" @> $284 or ("plr"."attribute" = $285) and "plr"."value" @> $286 or ("plr"."attribute" = $287) and "plr"."value" @> $288 or ("plr"."attribute" = $289) and "plr"."value" @> $290 or ("plr"."attribute" = $291) and "plr"."value" @> $292 or ("plr"."attribute" = $293) and "plr"."value" @> $294 or ("plr"."attribute" = $295) and "plr"."value" @> $296 or ("plr"."attribute" = $297) and "plr"."value" @> $298 or ("plr"."attribute" = $299) and "plr"."value" @> $300 or ("plr"."attribute" = $301) and "plr"."value" @> $302 or ("plr"."attribute" = $303) and "plr"."value" @> $304 or ("plr"."attribute" = $305) and "plr"."value" @> $306 or ("plr"."attribute" = $307) and "plr"."value" @> $308 or ("plr"."attribute" = $309) and "plr"."value" @> $310 or ("plr"."attribute" = $311) and "plr"."value" @> $312 or ("plr"."attribute" = $313) and "plr"."value" @> $314 or ("plr"."attribute" = $315) and "plr"."value" @> $316 or ("plr"."attribute" = $317) and "plr"."value" @> $318 or ("plr"."attribute" = $319) and "plr"."value" @> $320 or ("plr"."attribute" = $321) and "plr"."value" @> $322 or ("plr"."attribute" = $323) and "plr"."value" @> $324 or ("plr"."attribute" = $325) and "plr"."value" @> $326 or ("plr"."attribute" = $327) and "plr"."value" @> $328 or ("plr"."attribute" = $329) and "plr"."value" @> $330 or ("plr"."attribute" = $331) and "plr"."value" @> $332 or ("plr"."attribute" = $333) and "plr"."value" @> $334 or ("plr"."attribute" = $335) and "plr"."value" @> $336 or ("plr"."attribute" = $337) and "plr"."value" @> $338 or ("plr"."attribute" = $339) and "plr"."value" @> $340 or ("plr"."attribute" = $341) and "plr"."value" @> $342 or ("plr"."attribute" = $343) and "plr"."value" @> $344 or ("plr"."attribute" = $345) and "plr"."value" @> $346 or ("plr"."attribute" = $347) and "plr"."value" @> $348 or ("plr"."attribute" = $349) and "plr"."value" @> $350 or ("plr"."attribute" = $351) and "plr"."value" @> $352 or ("plr"."attribute" = $353) and "plr"."value" @> $354 or ("plr"."attribute" = $355) and "plr"."value" @> $356 or ("plr"."attribute" = $357) and "plr"."value" @> $358 or ("plr"."attribute" = $359) and "plr"."value" @> $360 or ("plr"."attribute" = $361) and "plr"."value" @> $362 or ("plr"."attribute" = $363) and "plr"."value" @> $364 or ("plr"."attribute" = $365) and "plr"."value" @> $366 or ("plr"."attribute" = $367) and "plr"."value" @> $368 or ("plr"."attribute" = $369) and "plr"."value" @> $370 or ("plr"."attribute" = $371) and "plr"."value" @> $372 or ("plr"."attribute" = $373) and "plr"."value" @> $374 or ("plr"."attribute" = $375) and "plr"."value" @> $376 or ("plr"."attribute" = $377) and "plr"."value" @> $378 or ("plr"."attribute" = $379) and "plr"."value" @> $380 or ("plr"."attribute" = $381) and "plr"."value" @> $382 or ("plr"."attribute" = $383) and "plr"."value" @> $384 or ("plr"."attribute" = $385) and "plr"."value" @> $386 or ("plr"."attribute" = $387) and "plr"."value" @> $388 or ("plr"."attribute" = $389) and "plr"."value" @> $390 or ("plr"."attribute" = $391) and "plr"."value" @> $392 or ("plr"."attribute" = $393) and "plr"."value" @> $394 or ("plr"."attribute" = $395) and "plr"."value" @> $396 or ("plr"."attribute" = $397) and "plr"."value" @> $398 or ("plr"."attribute" = $399) and "plr"."value" @> $400 or ("plr"."attribute" = $401) and "plr"."value" @> $402 or ("plr"."attribute" = $403) and "plr"."value" @> $404 or ("plr"."attribute" = $405) and "plr"."value" @> $406 or ("plr"."attribute" = $407) and "plr"."value" @> $408 or ("plr"."attribute" = $409) and "plr"."value" @> $410 or ("plr"."attribute" = $411) and "plr"."value" @> $412 or ("plr"."attribute" = $413) and "plr"."value" @> $414 or ("plr"."attribute" = $415) and "plr"."value" @> $416 or ("plr"."attribute" = $417) and "plr"."value" @> $418 or "pl"."rules_count" = $419) and ((("pr"."attribute" = $420 and "pr"."value" in ($421)) or ("pr"."attribute" = $422 and "pr"."value" in ($423)) or ("pr"."attribute" = $424 and "pr"."value" in ($425)) or ("pr"."attribute" = $426 and ("pr"."operator" = $427 and $428 >= pr.value::numeric) or ("pr"."operator" = $429 and $430 > pr.value::numeric) or ("pr"."operator" = $431 and $432 < pr.value::numeric) or ("pr"."operator" = $433 and $434 <= pr.value::numeric) or ("pr"."operator" = $435 and $436 = pr.value::numeric)) or ("pr"."attribute" = $437 and ("pr"."operator" = $438 and $439 >= pr.value::numeric) or ("pr"."operator" = $440 and $441 > pr.value::numeric) or ("pr"."operator" = $442 and $443 < pr.value::numeric) or ("pr"."operator" = $444 and $445 <= pr.value::numeric) or ("pr"."operator" = $446 and $447 = pr.value::numeric)) or ("pr"."attribute" = $448 and "pr"."value" in ($449)) or ("pr"."attribute" = $450 and "pr"."value" in ($451)) or ("pr"."attribute" = $452 and "pr"."value" in ($453)) or ("pr"."attribute" = $454 and "pr"."value" in ($455)) or ("pr"."attribute" = $456 and "pr"."value" in ($457)) or ("pr"."attribute" = $458 and "pr"."value" in ($459)) or ("pr"."attribute" = $460 and "pr"."value" in ($461)) or ("pr"."attribute" = $462 and "pr"."value" in ($463)) or ("pr"."attribute" = $464 and "pr"."value" in ($465)) or ("pr"."attribute" = $466 and "pr"."value" in ($467)) or ("pr"."attribute" = $468 and "pr"."value" in ($469)) or ("pr"."attribute" = $470 and "pr"."value" in ($471, $472)) or ("pr"."attribute" = $473 and "pr"."value" in ($474, $475)) or ("pr"."attribute" = $476 and "pr"."value" in ($477, $478)) or ("pr"."attribute" = $479 and "pr"."value" in ($480, $481)) or ("pr"."attribute" = $482 and "pr"."value" in ($483, $484)) or ("pr"."attribute" = $485 and "pr"."value" in ($486, $487)) or ("pr"."attribute" = $488 and "pr"."value" in ($489, $490)) or ("pr"."attribute" = $491 and "pr"."value" in ($492, $493)) or ("pr"."attribute" = $494 and "pr"."value" in ($495, $496)) or ("pr"."attribute" = $497 and "pr"."value" in ($498, $499)) or ("pr"."attribute" = $500 and "pr"."value" in ($501, $502)) or ("pr"."attribute" = $503 and "pr"."value" in ($504, $505)) or ("pr"."attribute" = $506 and "pr"."value" in ($507, $508)) or ("pr"."attribute" = $509 and "pr"."value" in ($510, $511)) or ("pr"."attribute" = $512 and "pr"."value" in ($513, $514)) or ("pr"."attribute" = $515 and "pr"."value" in ($516, $517)) or ("pr"."attribute" = $518 and "pr"."value" in ($519, $520)) or ("pr"."attribute" = $521 and "pr"."value" in ($522, $523)) or ("pr"."attribute" = $524 and "pr"."value" in ($525, $526)) or ("pr"."attribute" = $527 and "pr"."value" in ($528, $529)) or ("pr"."attribute" = $530 and "pr"."value" in ($531, $532)) or ("pr"."attribute" = $533 and "pr"."value" in ($534, $535)) or ("pr"."attribute" = $536 and "pr"."value" in ($537, $538)) or ("pr"."attribute" = $539 and "pr"."value" in ($540, $541)) or ("pr"."attribute" = $542 and "pr"."value" in ($543, $544)) or ("pr"."attribute" = $545 and "pr"."value" in ($546, $547)) or ("pr"."attribute" = $548 and "pr"."value" in ($549, $550)) or ("pr"."attribute" = $551 and "pr"."value" in ($552, $553)) or ("pr"."attribute" = $554 and "pr"."value" in ($555, $556)) or ("pr"."attribute" = $557 and "pr"."value" in (($558), ())) or ("pr"."attribute" = $559 and "pr"."value" in ($560, $561)) or ("pr"."attribute" = $562 and "pr"."value" in ($563, $564)) or ("pr"."attribute" = $565 and "pr"."value" in ($566, $567)) or ("pr"."attribute" = $568 and "pr"."value" in ($569, $570)) or ("pr"."attribute" = $571 and "pr"."value" in ($572, $573)) or ("pr"."attribute" = $574 and "pr"."value" in ($575, $576)) or ("pr"."attribute" = $577 and "pr"."value" in ($578, $579)) or ("pr"."attribute" = $580 and "pr"."value" in ($581, $582)) or ("pr"."attribute" = $583 and "pr"."value" in ($584, $585)) or ("pr"."attribute" = $586 and "pr"."value" in ($587, $588)) or ("pr"."attribute" = $589 and "pr"."value" in ($590, $591)) or ("pr"."attribute" = $592 and "pr"."value" in ($593, $594)) or ("pr"."attribute" = $595 and "pr"."value" in ($596, $597)) or ("pr"."attribute" = $598 and "pr"."value" in ($599, $600)) or ("pr"."attribute" = $601 and "pr"."value" in ($602, $603)) or ("pr"."attribute" = $604 and "pr"."value" in ($605, $606)) or ("pr"."attribute" = $607 and "pr"."value" in ($608, $609)) or ("pr"."attribute" = $610 and "pr"."value" in ($611, $612)) or ("pr"."attribute" = $613 and "pr"."value" in ($614, $615)) or ("pr"."attribute" = $616 and "pr"."value" in ($617, $618)) or ("pr"."attribute" = $619 and "pr"."value" in ($620, $621)) or ("pr"."attribute" = $622 and "pr"."value" in ($623, $624)) or ("pr"."attribute" = $625 and "pr"."value" in ($626, $627)) or ("pr"."attribute" = $628 and "pr"."value" in ($629, $630)) or ("pr"."attribute" = $631 and "pr"."value" in ($632, $633)) or ("pr"."attribute" = $634 and "pr"."value" in ($635, $636)) or ("pr"."attribute" = $637 and "pr"."value" in ($638, $639)) or ("pr"."attribute" = $640 and "pr"."value" in ($641, $642)) or ("pr"."attribute" = $643 and "pr"."value" in ($644, $645)) or ("pr"."attribute" = $646 and "pr"."value" in ($647, $648)) or ("pr"."attribute" = $649 and "pr"."value" in ($650, $651)) or ("pr"."attribute" = $652 and "pr"."value" in ($653, $654)) or ("pr"."attribute" = $655 and "pr"."value" in ($656, $657)) or ("pr"."attribute" = $658 and "pr"."value" in ($659, $660)) or ("pr"."attribute" = $661 and "pr"."value" in ($662, $663)) or ("pr"."attribute" = $664 and "pr"."value" in ($665, $666)) or ("pr"."attribute" = $667 and "pr"."value" in (($668), ($669))) and "price"."rules_count" > $670) or "price"."rules_count" = $671))) group by "price"."id", "pl"."id" having count(pr.attribute) = price.rules_count AND price.price_list_id IS NULL or count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL) as "price" on "price"."price_set_id" = "ps"."id" where "ps"."id" in ($672) and "price"."currency_code" = $673 and ("price"."min_quantity" <= $674 or "price"."min_quantity" is null) order by "price"."has_price_list" asc, "all_rules_count" desc, "amount" asc - syntax error at or near ")"

@riqwan
Copy link
Contributor

riqwan commented Dec 27, 2024

Ah sorry, just realized you mentioned add to cart @SaintsPrinting

Here's new instructions:

  1. Open node_modules/@medusajs/pricing/dist/repositories/pricing.js
  2. In line 35, add a new line and add the following:
console.log("context - ", JSON.stringify(context, null, 4))
console.log("flattenedContext - ", JSON.stringify(flattenedContext, null, 4))
Screenshot 2024-12-27 at 21 40 33

@riqwan
Copy link
Contributor

riqwan commented Dec 27, 2024

@SaintsPrinting you should see this output in the medusa server logs. There will be plenty of them logged here, just get the log closest to where the error is

@SaintsPrinting
Copy link

Here is the information with some of the information redacted for privacy:

http: GET /store/carts/cart_01JG4ECDHERB3JNE286XNK4GG4?fields=%2Aitems%2C%20%2Aregion%2C%20%2Aitems.product%2C%20%2Aitems.variant%2C%20%2Bitems.thumbnail%2C%20%2Bitems.metadata%2C%20%2Apromotions ← - (200) - 32.875 ms
context - {
"completed_at": null,
"id": "cart_01JG4ECDHERB3JNE286XNK4GG4",
"sales_channel_id": "sc_01J9DFVEXVAQ5GM05VZHC4RKAG",
"region_id": "reg_01J9DG1RHSC5K1BXXXQWHD82PG",
"item_total": 940.625,
"total": 940.625,
"email": "[REDACTED]",
"customer_id": "cus_01JB5S1YM10BY4KTY6N15CJB30",
"shipping_address": {
"city": "Tampa",
"country_code": "us",
"province": "FL",
"postal_code": "[REDACTED]"
},
"customer": {
"id": "cus_01JB5S1YM10BY4KTY6N15CJB30",
"groups": []
}
}
flattenedContext - [
[
"id",
"cart_01JG4ECDHERB3JNE286XNK4GG4"
],
[
"sales_channel_id",
"sc_01J9DFVEXVAQ5GM05VZHC4RKAG"
],
[
"region_id",
"reg_01J9DG1RHSC5K1BXXXQWHD82PG"
],
[
"item_total",
940.625
],
[
"total",
940.625
],
[
"email",
"[REDACTED]"
],
[
"customer_id",
"cus_01JB5S1YM10BY4KTY6N15CJB30"
],
[
"shipping_address.city",
"Tampa"
],
[
"shipping_address.country_code",
"us"
],
[
"shipping_address.province",
"FL"
],
[
"shipping_address.postal_code",
"[REDACTED]"
],
[
"customer.id",
"cus_01JB5S1YM10BY4KTY6N15CJB30"
]
]
context - {
"id": "cart_01JG4ECDHERB3JNE286XNK4GG4",
"sales_channel_id": "sc_01J9DFVEXVAQ5GM05VZHC4RKAG",
"region_id": "reg_01J9DG1RHSC5K1BXXXQWHD82PG",
"shipping_address": {
"city": "Tampa",
"country_code": "us",
"province": "FL",
"postal_code": "[REDACTED]"
},
"item_total": 958.625,
"total": 958.625,
"customer": {
"id": "cus_01JB5S1YM10BY4KTY6N15CJB30",
"groups": []
}
}
flattenedContext - [
[
"id",
"cart_01JG4ECDHERB3JNE286XNK4GG4"
],
[
"sales_channel_id",
"sc_01J9DFVEXVAQ5GM05VZHC4RKAG"
],
[
"region_id",
"reg_01J9DG1RHSC5K1BXXXQWHD82PG"
],
[
"shipping_address.city",
"Tampa"
],
[
"shipping_address.country_code",
"us"
],
[
"shipping_address.province",
"FL"
],
[
"shipping_address.postal_code",
"[REDACTED]"
],
[
"item_total",
958.625
],
[
"total",
958.625
],
[
"customer.id",
"cus_01JB5S1YM10BY4KTY6N15CJB30"
]
]
context - {
"id": "cart_01JG4ECDHERB3JNE286XNK4GG4",
"sales_channel_id": "sc_01J9DFVEXVAQ5GM05VZHC4RKAG",
"region_id": "reg_01J9DG1RHSC5K1BXXXQWHD82PG",
"item_total": 958.625,
"total": 958.625,
"items": [
{
"id": "cali_01JG4ECDPMV1DYP41FMZFXP6MC",
"title": "White Strip",
"subtitle": "Event Tent",
"thumbnail": "[REDACTED]",
"quantity": 1,
"variant_id": "variant_01JAZCZ2QBEPFKAKARTF1M850N",
"product_id": "prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"product_title": "Event Tent",
"product_description": null,
"product_subtitle": "10' x 10'",
"product_type": null,
"product_type_id": null,
"product_collection": null,
"product_handle": "tent",
"variant_sku": null,
"variant_barcode": null,
"variant_title": "White Strip",
"variant_option_values": null,
"requires_shipping": true,
"is_discountable": true,
"is_tax_inclusive": false,
"is_custom_price": false,
"metadata": {},
"cart_id": "cart_01JG4ECDHERB3JNE286XNK4GG4",
"raw_compare_at_unit_price": null,
"raw_unit_price": {
"value": "875",
"precision": 20
},
"created_at": "2024-12-27T16:14:52.629Z",
"updated_at": "2024-12-27T16:24:07.215Z",
"deleted_at": null,
"adjustments": [],
"tax_lines": [
{
"id": "calitxl_01JG4EDB342DBQNV6BCFFAPR3Q",
"description": "TaxJar-82121500A0000",
"code": "82121500A0000",
"rate": 7.5,
"provider_id": "tax-jar-provider",
"metadata": null,
"tax_rate_id": null,
"item_id": "cali_01JG4ECDPMV1DYP41FMZFXP6MC",
"created_at": "2024-12-27T16:15:22.724Z",
"updated_at": "2024-12-27T16:15:22.724Z",
"deleted_at": null,
"total": 65.625,
"subtotal": 65.625,
"raw_total": {
"value": "65.625",
"precision": 20
},
"raw_subtotal": {
"value": "65.625",
"precision": 20
}
}
],
"compare_at_unit_price": null,
"unit_price": 875,
"subtotal": 875,
"total": 940.625,
"original_total": 940.625,
"discount_total": 0,
"discount_subtotal": 0,
"discount_tax_total": 0,
"tax_total": 65.625,
"original_tax_total": 65.625,
"raw_subtotal": {
"value": "875",
"precision": 20
},
"raw_total": {
"value": "940.625",
"precision": 20
},
"raw_original_total": {
"value": "940.625",
"precision": 20
},
"raw_discount_total": {
"value": "0",
"precision": 20
},
"raw_discount_subtotal": {
"value": "0",
"precision": 20
},
"raw_discount_tax_total": {
"value": "0",
"precision": 20
},
"raw_tax_total": {
"value": "65.625",
"precision": 20
},
"raw_original_tax_total": {
"value": "65.625",
"precision": 20
},
"variant": {
"id": "variant_01JAZCZ2QBEPFKAKARTF1M850N",
"weight": null,
"length": null,
"height": null,
"width": null,
"material": null,
"product_id": "prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"product": {
"id": "prod_01JAZCZ1MGJ27ESXZGESN4JABW"
}
},
"product": {
"id": "prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"collection_id": null,
"categories": [
{
"id": "pcat_01JEBHBWVM43FXF0JHE6W48R67"
}
],
"tags": []
}
},
{
"id": "cali_01JG4EXB88JNMHTZ6XBV5APGCG",
"title": "36" W x 10" H / Single Sided",
"subtitle": "Greeting Signs",
"thumbnail": "[REDACTED]",
"quantity": 1,
"variant_id": "variant_01JB5NK0D2AHTGMK7R5CNNS5ZK",
"product_id": "prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N",
"product_title": "Greeting Signs",
"product_description": "PVC Poster signs are perfect for making short term outdoor and long term indoor advertisements. The boards are water-resistant. These substrates come in 1/8" thickness to fit most display stands. PVC is printed with UV inks.",
"product_subtitle": null,
"product_type": null,
"product_type_id": null,
"product_collection": null,
"product_handle": "greeting-signs",
"variant_sku": null,
"variant_barcode": null,
"variant_title": "36" W x 10" H / Single Sided",
"variant_option_values": null,
"requires_shipping": true,
"is_discountable": true,
"is_tax_inclusive": false,
"is_custom_price": false,
"metadata": {},
"cart_id": "cart_01JG4ECDHERB3JNE286XNK4GG4",
"raw_compare_at_unit_price": null,
"raw_unit_price": {
"value": "18",
"precision": 20
},
"created_at": "2024-12-27T16:24:07.177Z",
"updated_at": "2024-12-27T16:24:07.215Z",
"deleted_at": null,
"adjustments": [],
"tax_lines": [],
"compare_at_unit_price": null,
"unit_price": 18,
"subtotal": 18,
"total": 18,
"original_total": 18,
"discount_total": 0,
"discount_subtotal": 0,
"discount_tax_total": 0,
"tax_total": 0,
"original_tax_total": 0,
"raw_subtotal": {
"value": "18",
"precision": 20
},
"raw_total": {
"value": "18",
"precision": 20
},
"raw_original_total": {
"value": "18",
"precision": 20
},
"raw_discount_total": {
"value": "0",
"precision": 20
},
"raw_discount_subtotal": {
"value": "0",
"precision": 20
},
"raw_discount_tax_total": {
"value": "0",
"precision": 20
},
"raw_tax_total": {
"value": "0",
"precision": 20
},
"raw_original_tax_total": {
"value": "0",
"precision": 20
},
"variant": {
"id": "variant_01JB5NK0D2AHTGMK7R5CNNS5ZK",
"weight": null,
"length": null,
"height": null,
"width": null,
"material": null,
"product_id": "prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N",
"product": {
"id": "prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N"
}
},
"product": {
"id": "prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N",
"collection_id": null,
"categories": [
{
"id": "pcat_01JEBHF5WQ61T6DT17BR6HC1VW"
}
],
"tags": []
}
}
],
"shipping_address": {
"id": "caaddr_01JG4ED3MAZVFBVR5T7NBGPKYM",
"customer_id": null,
"company": "",
"first_name": "[REDACTED]",
"last_name": "[REDACTED]",
"address_1": "[REDACTED]",
"address_2": "",
"city": "Tampa",
"country_code": "us",
"province": "FL",
"postal_code": "[REDACTED]",
"phone": "[REDACTED]",
"metadata": null,
"created_at": "2024-12-27T16:15:15.082Z",
"updated_at": "2024-12-27T16:15:15.082Z",
"deleted_at": null
}
}
flattenedContext - [
[
"id",
"cart_01JG4ECDHERB3JNE286XNK4GG4"
],
[
"sales_channel_id",
"sc_01J9DFVEXVAQ5GM05VZHC4RKAG"
],
[
"region_id",
"reg_01J9DG1RHSC5K1BXXXQWHD82PG"
],
[
"item_total",
958.625
],
[
"total",
958.625
],
[
"shipping_address.id",
"caaddr_01JG4ED3MAZVFBVR5T7NBGPKYM"
],
[
"shipping_address.first_name",
"[REDACTED]"
],
[
"shipping_address.last_name",
"[REDACTED]"
],
[
"shipping_address.address_1",
"[REDACTED]"
],
[
"shipping_address.city",
"Tampa"
],
[
"shipping_address.country_code",
"us"
],
[
"shipping_address.province",
"FL"
],
[
"shipping_address.postal_code",
"[REDACTED]"
],
[
"shipping_address.phone",
"[REDACTED]"
],
[
"shipping_address.created_at",
"2024-12-27T16:15:15.082Z"
],
[
"shipping_address.updated_at",
"2024-12-27T16:15:15.082Z"
],
[
"items.id",
[
"cali_01JG4ECDPMV1DYP41FMZFXP6MC",
"cali_01JG4EXB88JNMHTZ6XBV5APGCG"
]
],
[
"items.title",
[
"White Strip",
"36" W x 10" H / Single Sided"
]
],
[
"items.subtitle",
[
"Event Tent",
"Greeting Signs"
]
],
[
"items.thumbnail",
[
"[REDACTED]",
"[REDACTED]"
]
],
[
"items.quantity",
[
1,
1
]
],
[
"items.variant_id",
[
"variant_01JAZCZ2QBEPFKAKARTF1M850N",
"variant_01JB5NK0D2AHTGMK7R5CNNS5ZK"
]
],
[
"items.product_id",
[
"prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N"
]
],
[
"items.product_title",
[
"Event Tent",
"Greeting Signs"
]
],
[
"items.product_description",
[
null,
"PVC Poster signs are perfect for making short term outdoor and long term indoor advertisements. The boards are water-resistant. These substrates come in 1/8" thickness to fit most display stands. PVC is printed with UV inks."
]
],
[
"items.product_subtitle",
[
"10' x 10'",
null
]
],
[
"items.product_type",
[
null,
null
]
],
[
"items.product_type_id",
[
null,
null
]
],
[
"items.product_collection",
[
null,
null
]
],
[
"items.product_handle",
[
"tent",
"greeting-signs"
]
],
[
"items.variant_sku",
[
null,
null
]
],
[
"items.variant_barcode",
[
null,
null
]
],
[
"items.variant_title",
[
"White Strip",
"36" W x 10" H / Single Sided"
]
],
[
"items.variant_option_values",
[
null,
null
]
],
[
"items.requires_shipping",
[
true,
true
]
],
[
"items.is_discountable",
[
true,
true
]
],
[
"items.is_tax_inclusive",
[
false,
false
]
],
[
"items.is_custom_price",
[
false,
false
]
],
[
"items.cart_id",
[
"cart_01JG4ECDHERB3JNE286XNK4GG4",
"cart_01JG4ECDHERB3JNE286XNK4GG4"
]
],
[
"items.raw_compare_at_unit_price",
[
null,
null
]
],
[
"items.raw_unit_price.value",
[
"875",
"18"
]
],
[
"items.raw_unit_price.precision",
[
20,
20
]
],
[
"items.created_at",
[
"2024-12-27T16:14:52.629Z",
"2024-12-27T16:24:07.177Z"
]
],
[
"items.updated_at",
[
"2024-12-27T16:24:07.215Z",
"2024-12-27T16:24:07.215Z"
]
],
[
"items.deleted_at",
[
null,
null
]
],
[
"items.tax_lines",
[
[
{
"id": "calitxl_01JG4EDB342DBQNV6BCFFAPR3Q",
"description": "TaxJar-82121500A0000",
"code": "82121500A0000",
"rate": 7.5,
"provider_id": "tax-jar-provider",
"metadata": null,
"tax_rate_id": null,
"item_id": "cali_01JG4ECDPMV1DYP41FMZFXP6MC",
"created_at": "2024-12-27T16:15:22.724Z",
"updated_at": "2024-12-27T16:15:22.724Z",
"deleted_at": null,
"total": 65.625,
"subtotal": 65.625,
"raw_total": {
"value": "65.625",
"precision": 20
},
"raw_subtotal": {
"value": "65.625",
"precision": 20
}
}
],
[]
]
],
[
"items.compare_at_unit_price",
[
null,
null
]
],
[
"items.unit_price",
[
875,
18
]
],
[
"items.subtotal",
[
875,
18
]
],
[
"items.total",
[
940.625,
18
]
],
[
"items.original_total",
[
940.625,
18
]
],
[
"items.discount_total",
[
0,
0
]
],
[
"items.discount_subtotal",
[
0,
0
]
],
[
"items.discount_tax_total",
[
0,
0
]
],
[
"items.tax_total",
[
65.625,
0
]
],
[
"items.original_tax_total",
[
65.625,
0
]
],
[
"items.raw_subtotal.value",
[
"875",
"18"
]
],
[
"items.raw_subtotal.precision",
[
20,
20
]
],
[
"items.raw_total.value",
[
"940.625",
"18"
]
],
[
"items.raw_total.precision",
[
20,
20
]
],
[
"items.raw_original_total.value",
[
"940.625",
"18"
]
],
[
"items.raw_original_total.precision",
[
20,
20
]
],
[
"items.raw_discount_total.value",
[
"0",
"0"
]
],
[
"items.raw_discount_total.precision",
[
20,
20
]
],
[
"items.raw_discount_subtotal.value",
[
"0",
"0"
]
],
[
"items.raw_discount_subtotal.precision",
[
20,
20
]
],
[
"items.raw_discount_tax_total.value",
[
"0",
"0"
]
],
[
"items.raw_discount_tax_total.precision",
[
20,
20
]
],
[
"items.raw_tax_total.value",
[
"65.625",
"0"
]
],
[
"items.raw_tax_total.precision",
[
20,
20
]
],
[
"items.raw_original_tax_total.value",
[
"65.625",
"0"
]
],
[
"items.raw_original_tax_total.precision",
[
20,
20
]
],
[
"items.variant.id",
[
"variant_01JAZCZ2QBEPFKAKARTF1M850N",
"variant_01JB5NK0D2AHTGMK7R5CNNS5ZK"
]
],
[
"items.variant.weight",
[
null,
null
]
],
[
"items.variant.length",
[
null,
null
]
],
[
"items.variant.height",
[
null,
null
]
],
[
"items.variant.width",
[
null,
null
]
],
[
"items.variant.material",
[
null,
null
]
],
[
"items.variant.product_id",
[
"prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N"
]
],
[
"items.variant.product.id",
[
"prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N"
]
],
[
"items.product.id",
[
"prod_01JAZCZ1MGJ27ESXZGESN4JABW",
"prod_01JB5NJYA6Y5GZVZFQMCQG8Z2N"
]
],
[
"items.product.collection_id",
[
null,
null
]
],
[
"items.product.categories",
[
[
{
"id": "pcat_01JEBHBWVM43FXF0JHE6W48R67"
}
],
[
{
"id": "pcat_01JEBHF5WQ61T6DT17BR6HC1VW"
}
]
]
]
]
error: select "price"."id" as "id", "ps"."id" as "price_set_id",

(this error is the same as the previous comment)

@riqwan
Copy link
Contributor

riqwan commented Dec 27, 2024

Thanks @SaintsPrinting, I think I can see what might go wrong here. Will open a PR soon! 🤞🏻

@SaintsPrinting
Copy link

Do you have an idea on how to get around this in the meantime?

@pixelwiese
Copy link
Contributor

Having only one shipping method worked for us, but not tested enough and depending on your use case not a great fix.

@SaintsPrinting
Copy link

One shipping method is fine for us but for some reason it's still not working, unfortunately I have to turn off automatic taxes for it to work.

@helloquang
Copy link
Author

helloquang commented Dec 29, 2024

I can't reproduce the issues on default seed data, is there anything I can provide to verify the issue ?

@jpmartinez-polstudios
Copy link

For me, I need to have automatic taxes on, then add something to the cart, proceed to almost checkout (going to payment), then going to the store to add another thing to the cart.

@docloulou
Copy link
Contributor

For me, I need to have automatic taxes on, then add something to the cart, proceed to almost checkout (going to payment), then going to the store to add another thing to the cart.

Same scenario here.

@riqwan maybe it's the wrong place to post issue. More details here : #10671 (comment)

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

6 participants