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

consumption-related fields - special cases of bulk products #1090

Closed
serpico opened this issue Dec 6, 2024 · 5 comments · Fixed by #1276
Closed

consumption-related fields - special cases of bulk products #1090

serpico opened this issue Dec 6, 2024 · 5 comments · Fixed by #1276

Comments

@serpico
Copy link

serpico commented Dec 6, 2024

In relation with #974 and after #1071 it feels like we'll need an evo to display and take into account the amount of products bought and inputted under Category.

In the screenshot I bought around 3.3 kg but there's no field yet to input that value, so for now the chip display is off ( for clarity and completeness, there's another product ( sold per item ) on that proof but it's missing from the list of bulk products available for now ).

If we want user to be able to keep track of all the bulk products they bought over a period of time.

There's also something in connection with discounted price here - I bought it discounted on account of buying by 2 kg ( cheaper than per 1 kg but more expensive than per 10 kg - ideally I'd want to able to store that info and be able to make use of it later ).

Image

@raphodn
Copy link
Member

raphodn commented Dec 9, 2024

Good catch ! Indeed for now we ask for price data, not actual "amount bought" data.
I'll update #974 and see if it can be integrated as is 🤔

@raphodn
Copy link
Member

raphodn commented Jan 2, 2025

So in #974 we added the Product.receipt_quantity field. But in the backend it only allowed "Positive integer" numbers.

I changed the backend here - openfoodfacts/open-prices#666 - to now allow any "Positive decimal" numbers !

Image

@raphodn raphodn closed this as completed Jan 2, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in 💸 Open Prices Jan 2, 2025
@serpico
Copy link
Author

serpico commented Jan 2, 2025

So for bulk product the UI will look like Abricots in the screenshot above ? what about just plain weight for products sold by weight ? 2500g or 2.5 kg in the above example.

@raphodn
Copy link
Member

raphodn commented Jan 2, 2025

You're still talking about receipts right ?

Improvements we could do, in line with your comment (correct me if I'm wrong !)

  • for the "Quantité achetée" field
    • if its a barcode-product: rename "Quantité achetée" to "Quantité achetée (unité)" and accept only integers
    • if its a category-product with a price per kg: rename "Quantité achetée" to "Quantité achetée (kg)" and accept decimals
    • if its a category-product with a price per unit: rename "Quantité achetée" to "Quantité achetée (unité)" and accept only integers
  • for the display in the "X prix déjà téléversés" (and elsewhere in the close future)
    • replace "x2" by "x2 unité"
    • replace "x2.5" by "x2.5 kg"
    • add an extra line indicating the actual amount bought

added in the todo of #1169

@serpico
Copy link
Author

serpico commented Jan 2, 2025

Thanks, that sounds about right ( optional display in grams instead of kg - but I agree it's cosmetic bordering OCD 😄 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants