Hi everyone,
I didn't have much luck looking in the forums, but my searching skills may need some work.
I am trying to call an API after order confirmation which will dispatch the order to a printer.
I've made a little test module that hooks on to displayOrderConfirmation, this works lovely. My challenge now is to dig out the data I need to send to the API. My problem is I have no idea which objects are available to me at this point.
I've tried dumping some objects to see what's what.
$orderObject = $params['objOrder'];
$customerObj = $params['objOrder']->getCustomer();
$addressId = $orderObject->id_address_delivery;
$address = new Address(intval($orderObject->id_address_delivery));
$this->Dump($address, "ADDRESS");
foreach ($params['objOrder']->getProducts() as $product)
{
$this->Dump($params, "PRODUCT");
}
$this->Dump($orderObject, "ORDER");
$this->Dump($customerObj, "CUSTOMER");
So far I've found the delivery address, customer looks fine aswell. I have some trouble with finding the product names. I think they showed up when I just dumped the entire getProducts array.
So I guess my questions are:
Am I getting the address correctly, is this best practice?
Am I getting the customer data correctly?
How do I get proper order and product data, specifically the product names, if possible attributes and price impact of those?
Thanks in advance and have a nice day