Prestashop:使用 prestashop 获取单个产品的详细信息 类

Prestashop: get details of a single product using prestashop classes

我正在为自定义 Prestashop 模块开发代码。我可以使用 Product::getProducts(...) 访问我的模块中所有产品的列表,但是我不知道如何访问指定产品的详细信息 ID.Can 有人告诉我如何实现吗?

// there is Product object that contains all details of certain product.
// for arguments details see in classes/Product.php constructor method    
$product = new Product($id_of_product_that_you_have, false, $id_lang); 
echo $product->name, $product->description; // etc

要获取产品的具体描述, 首先,您必须制作一个产品对象,为此您必须知道要获取描述的产品的 ID。

$product = new Product($product_id, false, $id_lang); 
$product_description = $product->description;
d($product_description);