[NEWS] GET /sale/categories/{categoryId}/parameters - dodaliśmy nowe pola do obsługi parametrów zależnych / GET /sale/categories/{categoryId}/parameters - we have added new fields for handling dependent parameters
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 244
- Forks
- 40
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**16.11.2020** planujemy wdrożyć kolejny etap obsługi parametrów zależnych - warunkową obowiązkowość i wyświetlanie. Więcej o parametrach zależnych przeczytacie w naszym [wcześniejszym komunikacie](https://developer.allegro.pl/news/#dependent-parameters). Dzięki parametrom zależnym uprościmy nawigację, a kupujący będą mogli porównywać między sobą oferty znajdujące się dotąd w różnych kategoriach. Dodatkowo sprzedawcy będą mogli dodawać do ofert kompletne i adekwatne informacje, które będą odpowiadały charakterowi sprzedawanego produktu. Dzięki temu kupujący skuteczniej znajdzie dobrze opisane oferty.
**Warunkowa obowiązkowość oznacza, że wymagalność danego parametru uzależniona jest od wartości wybranej dla parametru warunkującego** np. jeżeli sprzedawca wybierze w parametrze “Stan” wartość “Nowy”, wtedy powinien też wiedzieć, jaka jest wartość parametru “Kod producenta”, dlatego oznaczymy go jako obowiązkowy. Jeżeli wybierze wartość “Używany”, wtedy parametr “Kod producenta” będzie opcjonalny, na wypadek gdyby produkt miał np. wytartą metkę.
**Warunkowa widoczność oznacza, że wyświetlenie danego parametru uzależnione jest od wartości wybranej dla parametru warunkującego** np. jeżeli w kategorii “Mydła” (258383) sprzedawca wybierze w parametrze “Rodzaj” wartość “Kostka”, wyświetlimy wtedy parametr “Waga”, a “Pojemność” ukryjemy. Z kolei, gdyby wybrał wartość “Płyn” lub “Pasta”, wtedy nastąpi odwrotna sytuacja - ukryjemy parametr “Waga”, a pokażemy “Pojemność”.
W związku z tym, dla [GET /sale/categories/{categoryId}/parameters](https://developer.allegro.pl/documentation/#operation/getFlatParametersUsingGET_2) dodaliśmy nowe pola:
- **options.requiredDependsOnValueIds** - w którym zwrócimy identyfikatory wartości parametru warunkującego, dla których ten parametr będzie wymagany, np. może się tutaj znaleźć identyfikator wartości “Nowy” dla parametru “Stan”,
- **options.displayDependsOnValueIds** - w którym zwrócimy zbiór identyfikatorów wartości parametru warunkującego, od których zależy, czy dany parametr będzie widoczny, np. jeżeli to pole dotyczy parametru “Pojemność” w kategorii “Mydła”, to zwrócimy tutaj identyfikatory wartości “Płyn i “Pasta”” dla parametru “Rodzaj”.
Na [stronie dla sprzedających](https://allegro.pl/dla-sprzedajacych/od-16-listopada-w-wybranych-kategoriach-serwisu-wprowadzamy-zalezna-obowiazkowosc-parametrow-produktu-6MPbO0n5qfL) znajdziesz listę pierwszych kategorii i parametrów, dla których wprowadzimy warunkową obowiązkowość i wyświetlanie.
**Przykładowa struktura odpowiedzi:**
```
{
"parameters": [
{
"id": "202877",
"name": "Liczba rdzeni procesora",
"type": "integer",
"required": false,
"requiredForProduct": false,
"unit": null,
"options": {
"variantsAllowed": true,
"variantsEqual": false,
"ambiguousValueId": null,
"dependsOnParameterId": "202870",
"requiredDependsOnValueIds": [
"202870_1"
],
"displayDependsOnValueIds": [
"202870_1",
"202870_2"
],
"describesProduct": false
},
"restrictions": {
"min": 0,
"max": 1000000,
"range": false
}
}
]
}
```
-----
**On November 16th, 2020**, we plan to introduce the next stage of handling the dependent parameters - a conditional obligatory and display. You can read more information about dependent parameters in our [previous news](https://developer.allegro.pl/en/news/#dependent-parameters). Owing to the dependent parameters we will simplify navigation and buyers will be able to compare offers that so far are in various categories. In addition, sellers will be able to provide complete and adequate data to their offers, which will correspond to the nature of their product. As a result, buyers will find well-described offers easier.
**A conditional obligatory means that the requirement of the parameter depends on the value chosen for the conditioning parameter**, e.g. if the seller will choose “State” as “New”, then he should also know what is the “Manufacturer Code” value, so we will mark it as a mandatory. If he will choose “Used”, then the “Manufacturer Code” will be optional, for example, in the case when the product has a frayed label.
**A conditional display means that the visibility of the parameter depends on the value chosen for the conditioning parameter**, e.g. if in the “Soaps” category (258383) for the “Type” parameter seller will choose “bar”, we will display the “Weight” parameter and hide “Volume”. On the other hand, if the seller will choose the value “liquid” or “paste”, then we will hide the "Weight" parameter and show "Volume".
Therefore, we added new fields to [GET /sale/categories/{categoryId}/parameters](https://developer.allegro.pl/documentation/#operation/getFlatParametersUsingGET_2):
- **options.requiredDependsOnValueIds** - in which we will return the value identifier of the conditioning parameter, which determines whether a parameter will be required, e.g. ID of the value “New” for the “State” parameter,
- **options.displayDependsOnValueIds** - in which we will return a set of values identifiers of the conditioning parameter, which determines whether a parameter will be visible, e.g. if this field applies to the “Volume” parameter in the “Soaps” category, we will return identifiers of the “liquid” and “paste” values for the “Type” parameter.
You can find a list of the first categories and parameters for which we will introduce conditional obligatory and display on [for sellers page](https://allegro.pl/dla-sprzedajacych/od-16-listopada-w-wybranych-kategoriach-serwisu-wprowadzamy-zalezna-obowiazkowosc-parametrow-produktu-6MPbO0n5qfL).
**Sample response structure:**
```
{
"parameters": [
{
"id": "202877",
"name": "Liczba rdzeni procesora",
"type": "integer",
"required": false,
"requiredForProduct": false,
"unit": null,
"options": {
"variantsAllowed": true,
"variantsEqual": false,
"ambiguousValueId": null,
"dependsOnParameterId": "202870",
"requiredDependsOnValueIds": [
"202870_1"
],
"displayDependsOnValueIds": [
"202870_1",
"202870_2"
],
"describesProduct": false
},
"restrictions": {
"min": 0,
"max": 1000000,
"range": false
}
}
]
}
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.