openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
GNU Affero General Public License v3.0
633 stars 371 forks source link

Support EAN-13 for variable prices #1288

Open SantosSi opened 6 years ago

SantosSi commented 6 years ago

What

Steps to reproduce

Expected behavior

Observed behavior

Part of

teolemon commented 5 years ago

price: 02, 22, 24, 26, 28

L'indicatif est 02, révélateur d'un article à prix variable. Les caractères 3 à 7 indiquent le fabricant, le distributeur, ou encore si l'article est de type « Fruits et légumes ».
Les caractères 8 à 12 indiquent le prix de l'article. Ici, il est de 45,75, car on suppose que l'unité de prix sélectionné en préférences est centimes (457,5 si la préférence est sur décimes).

weight: 21, 23, 25, 27, 29.

le poids compris dans le code entre le 8ème et le 12ème caractère.
teolemon commented 5 years ago

@stephanegigandet for LDC

hangy commented 5 years ago

Barcode decoded into its elements. Was able to find an explanation only in German: https://www.selectline.ch/pdf/EAN-13%20fuer%20variable%20Gewichts-%20und%20Preiseinheiten.pdf

The mentioned document (GTIN: 7612345001807) says that this is valid for Switzerland. I don't know about international use, but the document seems like it could be out of date, because it refers to "VMN-13" as a term used for the 20-29 prefix range. According to WR 16-301, the term VMN (variable measure number) had only been used in the glossary, and has been deprecated in 2013. According to the current GS1 Specs (valid: Release 19), the same prefix range is reserved for Restricted Circulation Numbers within a geographic region. Thus, unfortunately, it looks like there is no general standard for decoding variable prices from barcodes.

hangy commented 5 years ago

Other countries

Notice from the Swedish website:

A variable weight number is national, which means that a Swedish variable weight number can only be used in Sweden.

SantosSi commented 5 years ago

My suggestion for the optimum solution as follows.

ItsJustRuby commented 1 year ago

+1 for the weight-based use case for this. Here in Switzerland, this system is used a lot for meat & meat products, and even branded pre-packaged cheeses, e.g. https://world.openfoodfacts.org/code/216419800xxxx (at time of writing, this page shows 30 results, all of which are different size chunks of the same mild Gruyère).

ItsJustRuby commented 1 year ago

(This part is off-topic)

Related to the variable-barcodes tag on this issue, I could not find a ticket for a similar issue (multiple barcodes mapping to the same product) yet, so my apologies if this is a duplicate issue:

Several Swiss supermarket chains use a system where they reduce products in price (in order to reduce food waste) by covering up the barcode with a custom variant. As an example:

Without knowing the technical specification, the barcode appears to contain a prefix (27) followed by the EAN-13 and more data (including the price of CHF 2.45 encoded as 245 at the end).

https://world.openfoodfacts.org/code/27xxxxxxxxxxxxxxxxxxxxxx contains more examples of this for the Swiss supermarket Coop. Similarly, Migros uses the prefix 31 as seen in the picture (but not scanned barcode) for https://world.openfoodfacts.org/product/7610745672252 , other examples at https://world.openfoodfacts.org/code/31xxxxxxxxxxxxxxxxxxxx .

It would be great if instead of creating duplicate products, these scanned barcodes would instead map to the same product.