id_order)); $products = $order->getProducts(); if (count($products) > 0) { foreach ($products as $product) { if ($product['id_configuration'] != 0) { $id_configurator = $product['id_configuration']; $options = ConfiguratorStorage::getOptProductFlatten($id_configurator); if (count($options)> 0) { foreach ($options as $group) { if ($group['type'] == 'file') { $value = $group['value'][0]; $source = _PS_ROOT_DIR_."/upload/simu/".$product['id_product']."/".$group['reference']."/".$value; $destPath = _PS_ROOT_DIR_."/orders/".$order->id."/".$product['id_product']."/".$group['reference']; $dest = $destPath."/".$value; // Create dir mkdir($destPath, 0777, true); // Copy file copy($source, $dest); } } } } } } } public function initContent() { parent::initContent(); $customer = $this->context->customer; $order = new Order($this->id_order); $cart = new Cart($order->id_cart); $carrier = new Carrier($order->id_carrier, Context::getContext()->language->id); $summary = $cart->getSummaryDetails(); $message = Message::getMessageByCartId($order->id_cart); $this->context->smarty->assign( array( 'customer' => $customer, 'order' => $order, 'carrier' => $carrier, 'recap' => true, 'products' => $summary['products'], 'delivery' => $summary['delivery'], 'invoice' => $summary['invoice'], 'discounts' => $summary['discounts'], 'total_discounts' => $summary['total_discounts'], 'total_wrapping' => $summary['total_wrapping'], 'total_products_wt' => $summary['total_products_wt'], 'gift_products' => $summary['gift_products'], 'noDeleteButton' => true, 'total_shipping' => $order->total_shipping_tax_incl, 'total_shipping_tax_exc' => $order->total_shipping_tax_excl, 'total_price' => $order->total_paid, 'voucherAllowed' => false, 'show_option_allow_separate_package' => false, 'message' => $message ) ); } }