Get category id return problem

  • woodhouse

    75 messaggi

    Italia

    Hi there,
    I would like to implement a function to get a category name given the category ID.
    First of all I do not understand why I need to specify a Parent ID insteand of the Category ID (honestly I do not understand)
    But the main problem I have is that the call retiurn the same content (void) if I set the ID of a leaf Category (eg. 710) of if I set the ID of a non existent category (eg. 21159)
    IMHO this is a bug.

    Thank you for help
    Daniele
  • Servitel

    448 messaggi

    Svizzera

    Hi Daniele
    the solution is to retrieve the full category list with the call Link (https)

    You receive back the master category id and name. you can record this data on a database table

    the you can navigate into parents by passing the parentid "&idParent=xxxx"

    with these calls you can retrieve the full category three (6 levels or less depending on the master category) with id ad name et voilà you have id and name for all cat/subcat. Record these data into the same table and then you can access to any category name by category id

    Hope this help you
    Roberto
  • woodhouse

    75 messaggi

    Italia

    Thank you Roberto for the answer.
    You suggestion is good to retrieve the full category tree and store it into a DB.
    Unfortunately it does not answer my problem.
    Daniele
  • @kevin
    Amministratore

    102 messaggi

    Belgio

    Hi woodhouse,

    Indeed, the "category" call does not return the detail of the category passed in parameter but only its children.
    We note your remark to improve the behavior of this one.

    Currently, the solution proposed by "Servitel" is correct and I think you should use this logic for your development.

    Here is an example where you can retrieve the children of a parent category in the desired language: Link (https)

    You can also consult this list here to find the necessary information that you need: Link (https)

    Best Regards,
    --
    Kevin
    Delcampe Team

Unisciti alla community di collezionisti!

Registrati Login