Skip to main content
19 votes

How to use Quotation mark in translation CSV Magento 2

you have to double the quotes in your language file. "Check ""Remember Me"" to access","Check ""Remember Me"" to access" | \| \| | | | | | | |...
Marius's user avatar
  • 198k
19 votes
Accepted

Read input csv file and convert it to array

In your controller file that $postUrl points to: protected $csv; public function __construct( \Magento\Framework\File\Csv $csv ) { $this->csv = $csv; } //The function name should match ...
PY Yick's user avatar
  • 2,705
12 votes
Accepted

Magento 2: Import multiple select attribute values using CSV

You can do this by just add multiple values by any separator and add that separator in Multiple value separator field. like this val1|val2|val3 check this screenshot. https://prnt.sc/ics5ur if you ...
Rakesh Varma's user avatar
  • 2,226
11 votes
Accepted

Admin Grid - Remove columns from export

Got it, if set is_system true for a column, it will not be exported.So $this->addColumn('customer_name', array( 'header' => Mage::helper('sales')->__('Customer'), 'index' ...
Abdul Ghaffar's user avatar
8 votes
Accepted

Product custom attribute import with CSV Magento 2

Upload from the default CSV generated by Magento Yes, you need to fill all your custom attributes into the single-column named additional_attributes_code. Just simply put all your custom attributes ...
Abhishek Tripathi's user avatar
8 votes
Accepted

Magento 2 Write to CSV within Controller

Try Following way, <?php protected $filesystem; protected $directoryList; protected $csvProcessor; public function __construct( \Magento\Framework\File\Csv $csvProcessor, \Magento\...
Rakesh Donga's user avatar
  • 5,364
7 votes

CSV Import: How can I import related products in Magento 2?

We've experienced the same issue, it seems import module has some kind of bug with related products We've solved it by writing a new console command which expects a 2 columns (parent sku & ...
Raul Sanchez's user avatar
  • 3,145
7 votes
Accepted

How to use Quotation mark in translation CSV Magento 2

Did a little bit of digging for this found it here: vendor/magento/module-persistent/i18n/en_US.csv The line states: "Check &quot;Remember Me&quot; to access your shopping cart on this ...
Atish Goswami's user avatar
6 votes
Accepted

magento 2: 'i18n:collect-phrases' command creates different csv files

The CSV with 4 columns is the global CSV for all modules. That's why it contains 3rd column as module and 4th column as Module_Name.This file should be placed in i18n folder parallel to app. The CSV ...
Gulshan's user avatar
  • 569
6 votes
Accepted

Magento 2: Create downloadable CSV

You should try with \Magento\Framework\App\Response\Http\FileFactory::create(). Take a look import export module you can see how it works: vendor/magento/module-import-export/Controller/Adminhtml/...
Khoa TruongDinh's user avatar
6 votes

Magento 2: Create downloadable CSV

This is not a new answer this is just addition to Khoa TruongDinh answers which helps me lot to solve my issue. when we use above syntax second parameter would be data which we want to put in a csv. ...
Ashish Madankar M2 Professiona's user avatar
6 votes
Accepted

Magento 2 : Priority of translation, proper way

Currently, language pack translations have priority over theme translations. This is going to be fixed in Magento 2.2, see https://github.com/magento/magento2/pull/7142
Fabian Schmengler's user avatar
6 votes

magento 2 / can't set addImageToMediaGallery path

In Magento 2, the root folder is not by default accessible. You need to put your testimg folder in pub/media to make it work. Move your folder to pub/media and update your code like below. Here you ...
Jaimin Sutariya's user avatar
6 votes

Product custom attribute import with CSV Magento 2

I have made one more test case and tried to upload with the name of attribute in csv. Instead of "additional_attributes" I have directly added name of a column and tried to upload value of a custom ...
Dhaval Solanki's user avatar
6 votes

Read input csv file and convert it to array

This it the controller file to save/read imported CSV data: <?php namespace VendorName\ModuleName\Controller\Adminhtml\Pincode\Import; use Magento\Framework\App\Filesystem\DirectoryList; class ...
Ronak Chauhan's user avatar
6 votes
Accepted

Import Product Dimensions (Length, Width, Height) in Magento 2

I found the correct headings to use by searching the attributes table of the database. Here are the headings to use, in case you find this searching like I was: ts_dimensions_length ...
iJeep's user avatar
  • 621
5 votes

Magento 2.1.2 - Importing multiselect attribute values from CSV

It is not currently natively supported by Magento. I found a workaround to manage it. I add multi-select new options dynamically during CSV validation. It works for manual import and Schedule EE ...
Franck Garnier's user avatar
5 votes
Accepted

Magento :Write form data to csv file

Set Dir path $path = Mage::getBaseDir('var') . DS . 'export' . DS; $name = 'yourFileName'; $file = $path . DS . $name . '.csv'; and save it $var_csv->saveData($file, $data_row); so it will be ...
Priyank's user avatar
  • 7,702
5 votes
Accepted

How to Create a excel file in custom module?

In Magento 2 Native, One php class \Magento\Framework\App\Response\Http\FileFactory is used for create csv and download CSV by magento way. create() function in FileFactory.php is used for create CSV ...
Shafeel Sha's user avatar
  • 1,395
5 votes
Accepted

How to get particular column data from the CSV?

Please try following way so you get email column data <?php $file = fopen('example.csv', 'r'); $c = 0; while (($line = fgetcsv($file)) !== FALSE) { //$line is an array of the csv elements $c++...
Chirag Gondaliya's user avatar
4 votes

How to add Upload Button for importing a csv file in the Custom Admin Grid Container?

Add button as per following: class XYZ_Brand_Block_Adminhtml_Brand extends Mage_Adminhtml_Block_Widget_Grid_Container { public function __construct() { $this->_controller = '...
sandip's user avatar
  • 4,024
4 votes

Magento 2 csv import : How to escape commas in additional_info?

You don't need to modify any code or your import file (as provide above) to get this to work. You can change the separator used for the 'additional_attributes' column by changing the value for the '...
JohnHughes1984's user avatar
4 votes

.csv tax file only uses the *last* line of the file for tax rates

Only the last line of the file is importing because you are using the same 'code' for 2 different tax rates. In the tax rates table 'code' is a unique field (like 'sky' is to a product) and therefore ...
JohnHughes1984's user avatar
4 votes

Adding images with CSV import

You must have to specify the _media_attribute_id and _media_image attribute. Without using these two attributes, you cannot import images properly. So the right CSV format for images import is as ...
Muhammad Saeed Khan's user avatar
4 votes

csv file format for setting table rate in magento 2

Go to Store >> Configuration >> Sales >> Shipping Methods >> Table Rates Export sample file that is already entered in Table Rates from export button. After exporting you ...
Chirag Prajapati's user avatar
4 votes

magento 2 varien_file_csv

The equivalent of Varien_File_Csv in Magento 2 is Magento\Framework\File\Csv. You can find it in lib/internal folders or in vendor/magento/framework depending on how you installed the application. ...
Marius's user avatar
  • 198k
4 votes
Accepted

Magento 2 import products with images

I figured out what the problem was... My customer sent me all these images with names like 4006501283382.01.jpg. When I tried to move this image to a different folder I realized that this image didn't ...
user3478148's user avatar
4 votes
Accepted

Magento 2 csv product import : How to escape commas in category name

To get the import to work I've resorted to exporting the csv using pipe (| ) separated fields in OpenOffice for Mac. You will need to change the Field separator from comma to pipe on the import page ...
Richard's user avatar
  • 193
4 votes

Magento 2 : Custom grid cannot export to csv or XML

You need to add a selections column element. See this example from sales_order_grid.xml (replace the indexField with the primary key from your model): <selectionsColumn name="ids"> <...
rb1193's user avatar
  • 41
4 votes

update product programmatically magento 2

I have experienced similar issues. The cause was that the ProductRepositories returns a product model with store_id > 0. If you save data then, it's only saved for the specified store view, but not ...
Andreas von Studnitz's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible