protected function generateCarrierData()
 {
     $delimiter = ';';
     $line = array();
     $titles = array();
     $id_lang = $this->use_lang;
     $new_path = new Sampledatainstall();
     $f = fopen($new_path->sendPath() . 'output/carriers.vsc', 'w');
     foreach ($this->carriers_fields as $field => $array) {
         $titles[] = $array['label'];
     }
     fputcsv($f, $titles, $delimiter, '"');
     $carriers = Carrier::getCarriers($id_lang);
     if ($carriers) {
         foreach ($carriers as $carrier) {
             $c = new Carrier($carrier['id_carrier'], $id_lang);
             foreach ($this->carriers_fields as $field => $array) {
                 $line[$field] = property_exists('Carrier', $field) && !is_array($c->{$field}) && !Tools::isEmpty($c->{$field}) ? $c->{$field} : '';
             }
             $line['carrier_groups'] = $c->getGroups($carrier['id_carrier']) ? implode(',', $this->oneL($c->getGroups($carrier['id_carrier']))) : '';
             $line['zones'] = $this->getCarrierZones($carrier['id_carrier']) ? implode(',', $this->getCarrierZones($carrier['id_carrier'])) : '';
             $line['range_price'] = $this->getRengePriceByCarrier('range_price', $carrier['id_carrier']) ? implode(',', $this->getRengePriceByCarrier('range_price', $carrier['id_carrier'])) : '';
             $line['range_weight'] = $this->getRengePriceByCarrier('range_weight', $carrier['id_carrier']) ? implode(',', $this->getRengePriceByCarrier('range_weight', $carrier['id_carrier'])) : '';
             if (file_exists(_PS_SHIP_IMG_DIR_ . $c->id . '.jpg')) {
                 $this->copyConverFileName(_PS_SHIP_IMG_DIR_ . $c->id . '.jpg');
             }
             if (!$line[$field]) {
                 $line[$field] = '';
             }
             fputcsv($f, $line, $delimiter, '"');
         }
     }
     fclose($f);
 }