1

I need to export these 2 products columns: description (HTML) and short description (HTML) to a CSV.

So far I've been using the dataflow profile system with a personal columns mapping but I cannot get those 2 columns (I'm using v1.9).

Please can anyone help me?

Thanks in advance.

0

Please try with below custom script :

Option 1 :

<?php
require './app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $_objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');
$registry = $_objectManager->get('Magento\Framework\Registry');
$registry->register('isSecureArea', true);

//Store id of exported products, This is useful when we have multiple stores. 
$store_id = 1;

$fp = fopen("productdata.csv","w+");


/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
/** Apply filters here */
$collection = $productCollection->addAttributeToSelect('*')
            ->load();


foreach ($collection as $product)
{
    $data = array();
    $data[] = $product->getSku();
    $data[] = $product->getDescription();
    $data[] = $product->getShortDescription();

fputcsv($fp, $data);    
}
fclose($fp)
?>

Option 2 :

Goto your phpmyadmin click 'database' than put below query than export output as CSV format

select * from catalog_product_entity_text where attribute_id IN (75,76);
  • Thanks Dan for your answer, but there is another detail: my shop is a multishop/multidomain with five langs. So should I specify the language before, or in the export there will be all the languages? And then will the column description and short description contain html tags? – Fabio Sep 26 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.