Nazar Posted April 18, 2018 Share Posted April 18, 2018 I exported products to .csv file, but, they haven't got description. How to export products with description? Link to comment Share on other sites More sharing options...
vpedroso.sweetcasa Posted December 2, 2018 Share Posted December 2, 2018 I have the same doubt.. looking forward for the experts inputs :-) Link to comment Share on other sites More sharing options...
nayonowe Posted January 21, 2020 Share Posted January 21, 2020 Here's the same, i'm using PS1.7 to export products with no desciption... Link to comment Share on other sites More sharing options...
tomerg3 Posted January 22, 2020 Share Posted January 22, 2020 How are you trying to export them? Link to comment Share on other sites More sharing options...
nayonowe Posted January 22, 2020 Share Posted January 22, 2020 10 hours ago, tomerg3 said: How are you trying to export them? Catalog->Products->Settings->export. Then i get an CSV file. When i open the CSV file i can see there are no product desciptions available. Link to comment Share on other sites More sharing options...
MarlexLadag Posted January 22, 2020 Share Posted January 22, 2020 For prestashop 1.7 You can have it in module or update the code. To update the code maybe you can try this. 1. src/PrestaShopBundle/Controller/Admin/ProductController.php . -> exportAction(...) method add in $headersData 'description' => $translator->trans('Description', array(), 'Admin.Global'), 2. src/Adapter/Product/AdminProductDataProvider.php -> getCatalogProductList(...) method add in $sqlSelect 'description' => array('table' => 'pl', 'field' => 'description', 'filtering' => ' %s '), 1 Link to comment Share on other sites More sharing options...
nayonowe Posted January 22, 2020 Share Posted January 22, 2020 9 hours ago, ML Software Services said: For prestashop 1.7 You can have it in module or update the code. To update the code maybe you can try this. 1. src/PrestaShopBundle/Controller/Admin/ProductController.php . -> exportAction(...) method add in $headersData 'description' => $translator->trans('Description', array(), 'Admin.Global'), 2. src/Adapter/Product/AdminProductDataProvider.php -> getCatalogProductList(...) method add in $sqlSelect 'description' => array('table' => 'pl', 'field' => 'description', 'filtering' => ' %s '), Thanks for your help. File 2 is not an problem, but in File1 the texture is completly different: public function exportAction() { return $this->get('prestashop.core.product.csv_exporter')->export(); } /** * Set the Catalog filters values and redirect to the catalogAction. * * URL example: /product/catalog_filters/42/last/32 * * @param int|string $quantity the quantity to set on the catalog filters persistence * @param string $active the activation state to set on the catalog filters persistence * * @return RedirectResponse */ public function catalogFiltersAction($quantity = 'none', $active = 'none') { $quantity = urldecode($quantity); /** @var ProductInterfaceProvider $productProvider */ $productProvider = $this->get('prestashop.core.admin.data_provider.product_interface'); // we merge empty filter set with given values, to reset the other filters! $productProvider->persistFilterParameters( array_merge( AdminFilter::getProductCatalogEmptyFilter(), [ 'filter_column_sav_quantity' => ($quantity == 'none') ? '' : $quantity, 'filter_column_active' => ($active == 'none') ? '' : $active, ] ) ); return $this->redirectToRoute('admin_product_catalog'); } /** * @deprecated since 1.7.5.0, to be removed in 1.8 rely on CommonController::renderFieldAction * * @throws \OutOfBoundsException * @throws \LogicException * @throws \PrestaShopException */ public function renderFieldAction($productId, $step, $fieldName) { @trigger_error( 'This function is deprecated, use CommonController::renderFieldAction instead.', E_USER_DEPRECATED ); $productAdapter = $this->get('prestashop.adapter.data_provider.product'); $product = $productAdapter->getProduct($productId); $modelMapper = new AdminModelAdapter( $product, $this->get('prestashop.adapter.legacy.context'), $this->get('prestashop.adapter.admin.wrapper.product'), $this->get('prestashop.adapter.tools'), $productAdapter, $this->get('prestashop.adapter.data_provider.supplier'), $this->get('prestashop.adapter.data_provider.warehouse'), $this->get('prestashop.adapter.data_provider.feature'), $this->get('prestashop.adapter.data_provider.pack'), $this->get('prestashop.adapter.shop.context'), $this->get('prestashop.adapter.data_provider.tax'), $this->get('router') ); $form = $this->createFormBuilder($modelMapper->getFormData()); switch ($step) { case 'step1': $form->add('step1', 'PrestaShopBundle\Form\Admin\Product\ProductInformation'); break; case 'step2': $form->add('step2', 'PrestaShopBundle\Form\Admin\Product\ProductPrice'); break; case 'step3': $form->add('step3', 'PrestaShopBundle\Form\Admin\Product\ProductQuantity'); break; case 'step4': $form->add('step4', 'PrestaShopBundle\Form\Admin\Product\ProductShipping'); break; case 'step5': $form->add('step5', 'PrestaShopBundle\Form\Admin\Product\ProductSeo'); break; case 'step6': $form->add('step6', 'PrestaShopBundle\Form\Admin\Product\ProductOptions'); break; case 'default': } return $this->render('@PrestaShop/Admin/Common/_partials/_form_field.html.twig', [ 'form' => $form->getForm()->get($step)->get($fieldName)->createView(), 'formId' => $step . '_' . $fieldName . '_rendered', ]); } } Link to comment Share on other sites More sharing options...
MarlexLadag Posted January 22, 2020 Share Posted January 22, 2020 (edited) 40 minutes ago, nayonowe said: Thanks for your help. File 2 is not an problem, but in File1 the texture is completly different: public function exportAction() { return $this->get('prestashop.core.product.csv_exporter')->export(); } /** * Set the Catalog filters values and redirect to the catalogAction. * * URL example: /product/catalog_filters/42/last/32 * * @param int|string $quantity the quantity to set on the catalog filters persistence * @param string $active the activation state to set on the catalog filters persistence * * @return RedirectResponse */ public function catalogFiltersAction($quantity = 'none', $active = 'none') { $quantity = urldecode($quantity); /** @var ProductInterfaceProvider $productProvider */ $productProvider = $this->get('prestashop.core.admin.data_provider.product_interface'); // we merge empty filter set with given values, to reset the other filters! $productProvider->persistFilterParameters( array_merge( AdminFilter::getProductCatalogEmptyFilter(), [ 'filter_column_sav_quantity' => ($quantity == 'none') ? '' : $quantity, 'filter_column_active' => ($active == 'none') ? '' : $active, ] ) ); return $this->redirectToRoute('admin_product_catalog'); } /** * @deprecated since 1.7.5.0, to be removed in 1.8 rely on CommonController::renderFieldAction * * @throws \OutOfBoundsException * @throws \LogicException * @throws \PrestaShopException */ public function renderFieldAction($productId, $step, $fieldName) { @trigger_error( 'This function is deprecated, use CommonController::renderFieldAction instead.', E_USER_DEPRECATED ); $productAdapter = $this->get('prestashop.adapter.data_provider.product'); $product = $productAdapter->getProduct($productId); $modelMapper = new AdminModelAdapter( $product, $this->get('prestashop.adapter.legacy.context'), $this->get('prestashop.adapter.admin.wrapper.product'), $this->get('prestashop.adapter.tools'), $productAdapter, $this->get('prestashop.adapter.data_provider.supplier'), $this->get('prestashop.adapter.data_provider.warehouse'), $this->get('prestashop.adapter.data_provider.feature'), $this->get('prestashop.adapter.data_provider.pack'), $this->get('prestashop.adapter.shop.context'), $this->get('prestashop.adapter.data_provider.tax'), $this->get('router') ); $form = $this->createFormBuilder($modelMapper->getFormData()); switch ($step) { case 'step1': $form->add('step1', 'PrestaShopBundle\Form\Admin\Product\ProductInformation'); break; case 'step2': $form->add('step2', 'PrestaShopBundle\Form\Admin\Product\ProductPrice'); break; case 'step3': $form->add('step3', 'PrestaShopBundle\Form\Admin\Product\ProductQuantity'); break; case 'step4': $form->add('step4', 'PrestaShopBundle\Form\Admin\Product\ProductShipping'); break; case 'step5': $form->add('step5', 'PrestaShopBundle\Form\Admin\Product\ProductSeo'); break; case 'step6': $form->add('step6', 'PrestaShopBundle\Form\Admin\Product\ProductOptions'); break; case 'default': } return $this->render('@PrestaShop/Admin/Common/_partials/_form_field.html.twig', [ 'form' => $form->getForm()->get($step)->get($fieldName)->createView(), 'formId' => $step . '_' . $fieldName . '_rendered', ]); } } Okay that was 1.7.3 did not noticed it. You can find it in the latest prestashop in /src/Core/Product/ProductCsvExporter.php I haven't tried this yet. Let me know if it works. If not I would love to try it in my side. Edited January 22, 2020 by ML Software Services (see edit history) Link to comment Share on other sites More sharing options...
MarlexLadag Posted January 22, 2020 Share Posted January 22, 2020 Okay that was 1.7.3 did not noticed it. You can find it in the latest prestashop in /src/Core/Product/ProductCsvExporter.php I haven't tried this yet. Let me know if it works. If not I would love to try it in my side. 1 Link to comment Share on other sites More sharing options...
zoomwi Posted March 26, 2021 Share Posted March 26, 2021 On 1/23/2020 at 12:41 AM, MarlexLadag said: Okay that was 1.7.3 did not noticed it. You can find it in the latest prestashop in /src/Core/Product/ProductCsvExporter.php I haven't tried this yet. Let me know if it works. If not I would love to try it in my side. It works! Thank you MarlexLadag :) Link to comment Share on other sites More sharing options...
MKTG2 Posted February 14, 2023 Share Posted February 14, 2023 Hi. Where do you update the code at? Link to comment Share on other sites More sharing options...
AdrianGoG Posted April 8, 2023 Share Posted April 8, 2023 Hello! Can the same thing be done to export more images? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now