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

[UI] added display of product variant original price on product page #11499

Conversation

JulienLoison
Copy link
Contributor

Q A
Branch? master
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Related tickets -
License MIT

Follows up @lchrusciel's comment on #11423 about variant prices not updating on the product page or variant not displaying discount if the first variant of the product has no discount.

@JulienLoison JulienLoison requested a review from a team as a code owner May 22, 2020 19:26
@probot-autolabeler probot-autolabeler bot added the Shop ShopBundle related issues and PRs. label May 22, 2020
Copy link
Member

@Zales0123 Zales0123 left a comment

Choose a reason for hiding this comment

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

Nice one 🎉

@JulienLoison JulienLoison force-pushed the feat/change-product-variant-original-price branch from c8f7e40 to 8bddc52 Compare May 25, 2020 15:06
if ($originalPrice > $price) {
$optionMap['original-price'] = $originalPrice;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

As I don't like nested if statements, I would go with:

if (!$this->productVariantPriceCalculator instanceof ProductVariantPricesCalculatorInterface) {
    return $optionMap;
}

if ($originalPrice > $price) {
    $optionMap['original-price'] = $originalPrice;
}

return $optionMap;

but it's not a blocker for me 🖖

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has @lchrusciel mentioned on the original PR, I'll try to add some original prices fixtures. I'll fix those nested if as well with the same PR.

Thanks for the review !

@lchrusciel lchrusciel merged commit 552db6d into Sylius:master May 26, 2020
@lchrusciel
Copy link
Member

Thanks, Julien! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Shop ShopBundle related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants