Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
lchrusciel merged 1 commit into
Sylius:masterfrom
JulienLoison:feat/change-product-variant-original-price
May 26, 2020
Merged

[UI] added display of product variant original price on product page#11499
lchrusciel merged 1 commit into
Sylius:masterfrom
JulienLoison:feat/change-product-variant-original-price

Conversation

@JulienLoison
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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 🎉

Comment thread src/Sylius/Behat/Context/Setup/ProductContext.php Outdated
Comment thread src/Sylius/Behat/Context/Ui/Shop/ProductContext.php Outdated
Comment thread src/Sylius/Component/Core/Provider/ProductVariantsPricesProvider.php Outdated
@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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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.

3 participants