diff --git a/www/override/classes/order/OrderDetail.php b/www/override/classes/order/OrderDetail.php index 7f96d544..7faf5a8a 100644 --- a/www/override/classes/order/OrderDetail.php +++ b/www/override/classes/order/OrderDetail.php @@ -100,7 +100,29 @@ class OrderDetail extends OrderDetailCore $this->id_configurator = (int)$product['id_configurator']; // Configurator Description - + $this->configurator_desc = ''; + if ($this->id_configurator != 0) { + $options = ConfiguratorStorage::getOptProductFlatten($this->id_configurator); + if (count($options) > 0) { + foreach ($options as $group) { + // Liste option to text + $this->configurator_desc.= $group['name'].': '; + $optCount = count($group['value']); + $i = 0; + foreach($group['value'] as $opt) { + // Si option est "file" alors copier image + if ($group['type'] == 'file') { + copy(_PS_UPLOAD_DIR_.'simu/'.$this->product_id.'/'.$group['reference'].'/'.$opt, + _PS_UPLOAD_DIR_.'orders/'.$this->id_order.'/'.$this->product_id.'/'.$group['reference'].'/'.$opt); + } + $i++; + $this->configurator_desc.= $opt; + if ($i < $optCount) { $this->configurator_desc.= ','; } + } + $this->configurator_desc.= "\n"; + } + } + } // Add new entry to the table $this->save();