commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Swell fixes

Open samuelfgs opened this issue 2 years ago • 3 comments

  • Fixed "use-add-item" hook: removed the checkoutId from the request variables. We can't pass the checkoutId to swell because they already use the current session to determine the checkoutId (see use-update-item and use-remove-item).
 {
    "code": "permission_error",
    "message": "You are not allowed to update `items.checkoutId`",
    "param": "items.checkoutId"
  }
  • Fixed search sort: remove the underscore from the sort values ("price_asc", "price_desc"). Swell expect the format ${field} ${direction}.

  • Fixed "use-login" hook:

Unhandled Runtime Error. TypeError: Cannot read properties of undefined (reading '0').

Receiving this error when an account doesn't exist.

  • Moved the product variants normalization to normalizeProduct: For my use case, I had to expand the "use-search" hook to add product variants too. The normalize function didn't work because it was expecting the variants to be normalized before (see the "get-product operations"). It makes more sense to normalize everything inside the normalize function.

  • Add includeSubCategories to "use-search" hook: In swell, you can define a category tree structure. For example

Category A
	Category B
		Product B1
		Product B2
Category C
	Product C1
	Category D
		Product D1
		Product D2

In the search page, if you filter by Category D, you would get product D1 and D2. But, if you filter C, you would only get product C1, or even worse, if you filter by Category A, the response is "No product found!"

samuelfgs avatar May 08 '22 14:05 samuelfgs

Someone is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 08 '22 14:05 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
commerce-bigcommerce ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-commercejs ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-kibocommerce ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-local ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-ordercloud ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-saleor ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-shopify ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-spree ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-swell ❌ Failed (Inspect) Apr 18, 2023 2:32am
commerce-vendure ❌ Failed (Inspect) Apr 18, 2023 2:32am

vercel[bot] avatar May 08 '22 14:05 vercel[bot]

Amazing! Thank you. Taking a look 👀

okbel avatar May 16 '22 13:05 okbel

Hey there! Thank you for your contribution. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: https://github.com/vercel/commerce/pull/966

leerob avatar Apr 18 '23 02:04 leerob