Skip to content

Have the ability to show how a price has been calculated #5041

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

Merged
merged 93 commits into from
Jul 30, 2025

Conversation

vladimir-8
Copy link
Contributor

@vladimir-8 vladimir-8 commented Jul 1, 2025

❗️Please do NOT merge yet

--

This is Part 2; Start reviewing with Part 1: #5038

--

Display price breakdown during delivery order creation:

Screenshot 2025-07-11 at 13 05 39

Display price breakdown on the order page:

Screenshot 2025-07-11 at 13 05 57

…etails-2

# Conflicts:
#	js/app/delivery/PriceCalculation.js
#	src/Api/State/CalculateRetailPriceProcessor.php
#	src/Controller/AdminController.php
…ing-details-2

# Conflicts:
#	config/services.yaml
#	src/Entity/Delivery/PricingRule.php
#	src/Service/PricingRuleSetManager.php
#	src/Sylius/Product/ProductOptionValueFactory.php
…etails-2

# Conflicts:
#	src/Entity/Sylius/ProductOptionRepository.php
@0bi0ne1312
Copy link

When you have multiple stops like on your screenshot, how do you be sure that a price goes with one particular price ? Is it possible to add an info like the "registered name" slot at the end of the title ?
This would be very useful to even better link a price to the stop

Capture 2025-07-21 à 08 32 01

*/
foreach ($productVariant->getOptionValues() as $productOptionValue) {

if ('CPCCL-ODDLVR-PERCENTAGE' === $productOptionValue->getOptionCode()) {
Copy link
Member

Choose a reason for hiding this comment

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

I didn't understand how this product option value is created?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each pricing rule is linked to a product option value: https://github.com/coopcycle/coopcycle-web/pull/5041/files#diff-6d0bf011cb02bc7af29f5165a12ba776544276b344a75a571000ef8c54c08551R76-R82

A product option value is in turn linked to a product option.

There are four product options at the moment, one for each type of a price expression: https://github.com/coopcycle/coopcycle-web/pull/5041/files#diff-2f4eb521f276a6cf3656e4edfc7da899063408d39c0b75f2b0b19fb3b68db0dfR42-R57

'CPCCL-ODDLVR-PERCENTAGE' is a product option for pricing rules with a price expression: price_percentage(.. https://github.com/coopcycle/coopcycle-web/pull/5041/files#diff-2f4eb521f276a6cf3656e4edfc7da899063408d39c0b75f2b0b19fb3b68db0dfR44-R46

@vladimir-8 vladimir-8 requested a review from alexsegura July 21, 2025 15:26
Copy link
Member

@alexsegura alexsegura left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feature/261-pricing-details to master July 30, 2025 17:25
@vladimir-8 vladimir-8 merged commit 3e0cf53 into master Jul 30, 2025
8 checks passed
@vladimir-8 vladimir-8 deleted the feature/261-pricing-details-2 branch July 30, 2025 17:27
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