我正在开发一个模块,当管理员将订单状态更改为“已发货”时,它会获取订单详细信息,以便使用 api 将它们发布到第三方应用程序。我正在使用 Prestashop V 1.7.7.0。
我仍然需要获取“国家”和“州”名称、“产品”和“订单信息”。请问我该怎么做?
此外,该模块无法安装在 prestashop 中。我的代码对吗?
请需要帮助。谢谢
public function hookActionOrderStatusPostUpdate($params)
{
if($params['newOrderStatus']->id == 13)
{
$order = new Order((int)$params['id_order']);
$address = new Address((int)$order->id_address_delivery);
$customer = new Customer((int)($address->id_customer));
$country = new Country((int)($address->id_country));
$state = new Country((int)($address->id_state));
$tel_cl = $address->phone;
$name_lastname_cl = $address->lastname . ' ' . $address->firstname;
$country_cl = **Not yet**;
$state_cl = **Not yet**;
$adress_cl = $address->address1 . ' ' . $address->address2;
$tel_2_cl = $address->phone_mobile
$products = **Not yet**;
$quantity = "1"
$cod = $order->total_paid
$note = **Not yet(order message)**;
$Url_str = 'http://example.com/api/set_parcel_post.php?id=123&tel_cl='.$tel_cl.'&name_lastname_cl='.$name_lastname_cl.'&country_cl='.$country_cl.'&state_cl='.$state_cl.'&address_cl='.$address_cl.'&tel_2_cl='.$tel_2_cl.'&products='.$products.'&cod='.$cod.'&Quantity='.$Quantity.'¬e='.$note;
$json = file_get_contents($Url_str);
$result = json_decode($json);
}
}