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

fix: do not display "add to cart" button if product has no price #1657

Merged
merged 3 commits into from
May 16, 2024

Conversation

shauke
Copy link
Collaborator

@shauke shauke commented May 13, 2024

PR Type

[x] Bugfix

What Is the Current Behavior?

On product detail pages and product listings products without a sale price display an "Add to Cart" button that will result in an error message regarding the failed action because of the missing price.

What Is the New Behavior?

Products without a sale price no longer have an "Add to Cart" button.

Does this PR Introduce a Breaking Change?

The ExternalDisplayPropertiesProvider setup notation was changed from providing only the product context to providing a combined { product, prices } context object to be able to depend the visibility of the add to basket button on an existing price.
For that reason any custom ContextDisplayPropertiesService that implements the ExternalDisplayPropertiesProvider needs to be adapted accordingly.

[x] Yes

Other Information

AB#96517

@shauke shauke self-assigned this May 13, 2024
@shauke shauke added this to the 5.2 milestone May 13, 2024
@shauke shauke requested a review from andreassteinmann May 13, 2024 11:07
@shauke shauke added the bug Something isn't working label May 13, 2024
@shauke shauke requested a review from dhhyi May 13, 2024 11:07
@shauke shauke force-pushed the bugfix/no_price_no_add_to_cart branch from 19b822f to 77a48cc Compare May 13, 2024 14:41
shauke added a commit that referenced this pull request May 15, 2024
…y the product from the product context but the prices too (#1657)

BREAKING CHANGES: works no longer with ProductView only but an Object with product and prices ... (migration notes)
shauke added a commit that referenced this pull request May 15, 2024
* handled via product context display properties
@shauke shauke force-pushed the bugfix/no_price_no_add_to_cart branch from 5be354b to 562e7f4 Compare May 15, 2024 10:00
shauke added a commit that referenced this pull request May 16, 2024
…not only the product from the product context but the prices too (#1657)
dhhyi and others added 3 commits May 16, 2024 15:12
…y the product from the product context but the prices too (#1657)

BREAKING CHANGES: The `ExternalDisplayPropertiesProvider` `setup` method was changed to no longer working with product data only but a combination of product and prices (see [Migrations / From 5.1 to 5.2](https://github.com/intershop/intershop-pwa/blob/develop/docs/guides/migrations.md#from-51-to-52) for more details).
* handled via product context display properties
* performance optimization to avoid unnecessary triggering of `loadProductParts` action for all products even if no parts are needed to be rendered
* the actual REST request was filtered in the effect to be only done for retail sets or bundles but the action was triggered all the time
@shauke shauke force-pushed the bugfix/no_price_no_add_to_cart branch from b68ff21 to a941bbe Compare May 16, 2024 13:20
@shauke shauke removed the request for review from andreassteinmann May 16, 2024 13:21
@shauke shauke merged commit e5f94f6 into develop May 16, 2024
23 checks passed
@shauke shauke deleted the bugfix/no_price_no_add_to_cart branch May 16, 2024 15:14
shauke pushed a commit that referenced this pull request May 16, 2024
…y the product from the product context but the prices too (#1657)

BREAKING CHANGES: The `ExternalDisplayPropertiesProvider` `setup` method was changed to no longer working with product data only but a combination of product and prices (see [Migrations / From 5.1 to 5.2](https://github.com/intershop/intershop-pwa/blob/develop/docs/guides/migrations.md#from-51-to-52) for more details).
shauke added a commit that referenced this pull request May 16, 2024
* handled via product context display properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants