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: issue with displaying product price od PDP and PLP #1053

Conversation

bartoszherba
Copy link
Collaborator

@bartoszherba bartoszherba commented May 24, 2022

Description

  • fix the issue with displaying prices of PDP
  • fix the issue with displaying prices of PLP
  • fix calculation of prices for the bundle, grouped products

Related Issue

#973

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Screenshot 2022-05-24 at 10 11 42

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

sethidden
sethidden previously approved these changes May 24, 2022
props: {
product: {
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>,
default: () => null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be required? You're accessing product.__typename in the template which will crash if product is null

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

},
props: {
product: {
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>,
type: Object as PropType<ReturnType<typeof useProductsWithCommonProductCardProps>['productsWithCommonProductCardProps']['value'][number] | null>,

Unfortunately this is the type you're looking for. Right now in this PR it's "the product prop is a function or null (typeof useProduct... is a function that accepts products)

What I suggested is the modified product returned by the commoncardprops

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awful...

@bartoszherba bartoszherba force-pushed the M2-573-sale-its-not-marked-anywhere-on-products-and-has-wrong-label-filter branch from 92160fc to e3e50d7 Compare May 25, 2022 05:53
@bartoszherba bartoszherba requested a review from sethidden May 25, 2022 05:54
@bartoszherba bartoszherba merged commit 9e5b0cc into develop May 25, 2022
@bartoszherba bartoszherba deleted the M2-573-sale-its-not-marked-anywhere-on-products-and-has-wrong-label-filter branch May 25, 2022 08:26
@Frodigo Frodigo added this to the 1.0.0-rc.8 milestone May 25, 2022
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.

3 participants