SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
285 stars 135 forks source link

[BUG] Unable to add simple products to cart #1247

Open cellmanguney opened 1 year ago

cellmanguney commented 1 year ago

Summary

Any normal/simple products can not be added to cart. It's blocked by the frontend validation. validateAndShowError() function is called at "add to cart" button, however validation is fails if no variant in the product.

Steps To Reproduce

go -> https://pwa-kit.mobify-storefront.com/global/en-GB/product/P0150M or any product that has no vairation click -> "add to cart" button error displays -> "Please select all your options above"

Expected result

We should able to add any item to cart

Actual result

Fails in validation

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-13546215

alexvuong commented 1 year ago

@cellmanguney Thank you for raising this issue! With current implementation, standard product is not fully integrated yet. We have created a ticket in our backlog to tackle it later.

In a meanwhile, if you want to fix this issue in your project, you may want to take a look at the validateOrderability func prop here. In this function, it is expected to have a variant to validate the choice. For standard product, there is no variant. You may want to change the logic in there to accept a standard product so it will pass the validation flow.

If you happened to use in an old version of the project, you may want to look at the canOrder property in the productView and modify the logic in there to allow standard product to be added to cart

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-13546385

AdamAnSubtractM commented 11 months ago

Confirming this is an issue for our company as well, we'll work on patching our code with the suggested fix above. Thanks.

AdamAnSubtractM commented 9 months ago

Hey Team,

Checking in on this one. Where do we stand with this one? Do we think there will be a fix sometime soon? Our team is in the process of implementing a fix for this but I'm sure as your team has realized there are a lot of cascading effects from fixing this one.

Thanks!

joeluong-sfcc commented 9 months ago

Hey @AdamAnSubtractM support for standard products is on the product roadmap, but it will most likely be a few months before that work is picked up.

Valpich commented 2 months ago

Hello @joeluong-sfcc ,

Any news on this subject?

Thanks a lot 🙏

joeluong-sfcc commented 2 months ago

Hi @Valpich, unfortunately priority for standard products has been pushed back a bit. It's still on the product roadmap but won't be worked on in the next few months, earliest we will pick it up is after that.

Valpich commented 2 months ago

Okay thanks