Utilisez le code ci-dessous pour exporter la description sans l'afficher dans la liste des produits Admin.
CHANGEMENTS:
1. src\Adapter\Product\AdminProductDataProvider.php , getCatalogProductList()
Add 'description' => ['table' => 'pl', 'field' => 'description'] , in $sqlSelect.Comme
$sqlSelect = [
'id_product' => ['table' => 'p', 'field' => 'id_product', 'filtering' => ' %s '],
'reference' => ['table' => 'p', 'field' => 'reference', 'filtering' => self::FILTERING_LIKE_BOTH],
'price' => ['table' => 'sa', 'field' => 'price', 'filtering' => ' %s '],
'id_shop_default' => ['table' => 'p', 'field' => 'id_shop_default'],
'is_virtual' => ['table' => 'p', 'field' => 'is_virtual'],
'name' => ['table' => 'pl', 'field' => 'name', 'filtering' => self::FILTERING_LIKE_BOTH],
'link_rewrite' => ['table' => 'pl', 'field' => 'link_rewrite', 'filtering' => self::FILTERING_LIKE_BOTH],
'active' => ['table' => 'sa', 'field' => 'active', 'filtering' => self::FILTERING_EQUAL_NUMERIC],
'shopname' => ['table' => 'shop', 'field' => 'name'],
'id_image' => ['table' => 'image_shop', 'field' => 'id_image'],
'name_category' => ['table' => 'cl', 'field' => 'name', 'filtering' => self::FILTERING_LIKE_BOTH],
'price_final' => '0',
'nb_downloadable' => ['table' => 'pd', 'field' => 'nb_downloadable'],
'sav_quantity' => ['table' => 'sav', 'field' => 'quantity', 'filtering' => ' %s '],
'description' => ['table' => 'pl', 'field' => 'description'] ,
'badge_danger' => ['select' => 'IF(sav.`quantity`<=0, 1, 0)', 'filtering' => 'IF(sav.`quantity`<=0, 1, 0) = %s'],
];
2. \src\Core\Product\ProductCsvExporter.php , export()
Add 'description' => $this->trans('Description', 'Admin.Global'), in $headersData. Comme
$headersData = [
'id_product' => 'Product ID',
'image_link' => $this->trans('Image', 'Admin.Global'),
'name' => $this->trans('Name', 'Admin.Global'),
'reference' => $this->trans('Reference', 'Admin.Global'),
'name_category' => $this->trans('Category', 'Admin.Global'),
'price' => $this->trans('Price (tax excl.)', 'Admin.Catalog.Feature'),
'price_final' => $this->trans('Price (tax incl.)', 'Admin.Catalog.Feature'),
'sav_quantity' => $this->trans('Quantity', 'Admin.Global'),
'badge_danger' => $this->trans('Status', 'Admin.Global'),
'description' => $this->trans('Description', 'Admin.Global'),
'position' => $this->trans('Position', 'Admin.Global'),
];
Après cela, si vous exportez la liste de produits, une colonne "Description" est ajoutée dans le fichier CSV exporté.