protected function createShopProduct(array $product, $order_id) { $shop_product = YousticeShopProduct::create(); $shop_product->setName($product['product_name']); $shop_product->setId($product['id_order_detail']); $shop_product->setPrice((double) $product['unit_price_tax_incl']); $shop_product->setDescription(''); $shop_product->setOtherInfo(''); //add image if exists if (count($product['image']) > 0) { //todo get image_format from $product['image'] ... $product['image']->image_format $image_path = _PS_PROD_IMG_DIR_ . $product['image']->getExistingImgPath() . '.jpg'; $shop_product->setImagePath($image_path); } $shop_product->setOrderId($order_id); $shop_product->setHref($this->createProductReportHref($order_id, $product['id_order_detail'])); return $shop_product; }