Jump to content

Modificare API CALL


mihaiIcey

Recommended Posts

Salut,
exista o metoda prin care pot modifica apelul api de la presta?

am: site.ro/api/products?output_format=JSON&display=[id,name,price,link_rewrite,id_default_image,id_category_default]

returneaza:

{
    "products": [
        {
            "id": 1,
            "id_category_default": "4",
            "id_default_image": "1",
            "price": "23.900000",
            "link_rewrite": "hummingbird-printed-t-shirt",
            "name": "Hummingbird printed t-shirt"
        },
        {
            "id": 2,
            "id_category_default": "5",
            "id_default_image": "21",
            "price": "35.900000",
            "link_rewrite": "brown-bear-printed-sweater",
            "name": "Hummingbird printed sweater"
        }
    ]
}


ma intereseaza ca pt "id_category_default" si "id_default_image" sa-mi returneze numele, respectiv link-ul imaginii.

Tot odata cautam un parametru pentru stare stock, nu am gasit asta in documentatie. Sau mi-a scapat, sunt nou in prestashop.

Are cineva o idee?

Link to comment
Share on other sites

  • 1 month later...

Pentru stocuri poti sa folosesti Stock availables API:
https://devdocs.prestashop-project.org/8/webservice/resources/stock_availables/


"
ma intereseaza ca pt "id_category_default" si "id_default_image" sa-mi returneze numele, respectiv link-ul imaginii."
Cel mai simplu este probabil sa faci un webservice nout, folosind hook-ol
public function hookAddWebserviceResources() {
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...