Jump to content

Manufacturer in MyModule


Recommended Posts

Bonjour,

 

Je débute sur Préstashop, et j'aurais besoin d'un petit coup de main concernant la récupération du Manufacturer dans un "MyModule"

 

J'arrive à avoir l'id_manufacturer avec la variable $cart->getProducts()

Mais je voulais savoir si c'était possible (et je suppose que oui) de récupérer le nom du manufacturer via l'id_manufacturer pour pouvoir l'afficher/le traiter.

 

Merci d'avance pour votre aide

 

 

 

Link to comment
Share on other sites

You can create a Manufacturer object using the $id_manufacturer to get the name. For example:

$manufacturer = new Manufacturer((int)$id_manufacturer);

if (Validate::isLoadedObject($manufacturer)) {
    echo $manufacturer->name;
}
Link to comment
Share on other sites

It works, thank you for your help :).
 
i have another question.
I need to call an API like that :
 

POST https://xxxxxxx.fr/api//users

Headers :

Authorization: xxxxxxxxxx

Accept: application/vnd.xxxx.v2+json

Content-Type: application/vnd.xxxxxx.v2+json

Body :

{

    "appuserid":"test0001",

                "type":2,

                "profile":

                {

....
}
 
Do you know an efficient and secure way to make that kind of call?

 

 

Thank you again for your help

 

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...