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

Swell fixes #748

Closed
wants to merge 1 commit into from
Closed

Swell fixes #748

wants to merge 1 commit into from

Conversation

samuelfgs
Copy link

  • 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!"

@vercel
Copy link

vercel bot commented May 8, 2022

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
Copy link

vercel bot commented May 8, 2022

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

@okbel
Copy link
Contributor

okbel commented May 16, 2022

Amazing! Thank you. Taking a look 👀

@leerob
Copy link
Member

leerob commented Apr 18, 2023

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: #966

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

Successfully merging this pull request may close these issues.

4 participants