I am trying to render the seller catalog as a radio button or checkbox and I have some confusion when it comes to min_selected_modifiers, max_selected_modifiers, and selection_type:
Firstly, selection_type is labeled as deprecated. Does that mean soon this value is going to disappear from the catalog-api? Or does it only mean we shouldn’t use it but it’s still going to be there in the responses?
Secondly, I have a sandbox modifier that is not reporting min_selected_modifiers and max_selected_modifiers but is reporting selection_type. When the min_selected_modifiers and max_selected_modifiers don’t report should we fall back on selection_type? Which brings me back to the first question that can we fall back on selection_type forever? If not how should we handle this?
If a field is labeled as deprecated, the field will still exist in responses, for backward compatibility, but new development should not rely on it.
If min_selected_modifiers and max_selected_modifiers are not present or are -1, the seller has not explicitly configured selection limits, so it defaults to no minimum/maximum on selected modifiers.
Generally, use radio buttons when max_selected_modifiers = 1, and use checkboxes when max_selected_modifiers > 1. Hope this helps!
@jseok Thank you for your response. Regarding your comment at the end, is it safe to say if max_selected_modifiersis not set or is -1, use the selection_typeto decide on rendering radio buttons vs checkboxes?
@arian.asghari95 If max_selected_modifiers is not set, then the default is unlimited modifiers, so the UX should render checkboxes. Again, since selection_type is deprecated, we would not recommend building any new development that depends on this field.
One caveat I want to make clear: you can also set item-level overrides inCatalogItemModifierListInfo - if both min_ and max_selected_modifiers are set to -1 here, then it will fall back to whatever value is set on the parent CatalogModifierList.
@jseok Thank you so much for the clarification. Regarding your second paragraph, I use the “Retrieve catalog object” endpoint, and set the include_related_objects to true, and I get the modifier min and max through "related_objects" → "modifier_list_data" → "max_selected_modifiers"and I don’t look at the "object" → "item_data" → "modifier_list_info" → "max_selected_modifiers" is that a correct approach?
@arian.asghari95 Since modifier settings can be overridden at the item-level, I would recommend checking max_selected_modifiers nested under item_databefore checking max_selected_modifiers under modifier_list_data. If the seller set a maximum on modifiers for a specific item but not for others, that configuration should be captured in your app, but your current setup would not account for that scenario. The configuration at the item_data level should take precedence over whatever settings are under the overall modifier list.
@jseok Interesting. So if I understand correctly, basically look at item_data , if max_selected_modifiersis not -1 use it. If it is -1, then use the max_selected_modifiers under modifier_list_data , correct?