Hot answers tagged

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" | \| \| | | | | | | |...
user avatar
  • 195k
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 ...
user avatar
  • 2,625
18 votes
Accepted

Is there a way to export all categories into a csv?

You could write this one pretty easily. Create a PHP file called something like export.php. <?php require("app/Mage.php"); // load the main Mage file Mage::app(); // not run() ...
user avatar
  • 2,825
12 votes
Accepted

Is there a list of default magento attributes?

Try installing fresh xampp magento and see its attributes list. Thats what I do when I want to see something default. Sometimes it takes longer to google such things, then taking matter up your own ...
user avatar
  • 286
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' ...
user avatar
10 votes
Accepted

How to read CSV with multi columns and reside in magento root dir?

You can use it in this way to get data from csv file: public function getCsvData($file){ $csvObject = new Varien_File_Csv(); try { return $csvObject->getData($file); } catch (...
user avatar
10 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 ...
user avatar
  • 2,096
9 votes

What is the best image fromat and size for products in magento

File formats Personally I find JPGs to be perfectly fine for use across Magento unless you need transparency, then 24bit PNG would be the way to go. Keep in mind PHP will compress the file when it ...
user avatar
  • 3,057
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\...
user avatar
  • 5,104
7 votes
Accepted

Can i use dataflow import to update products

Here's the steps I follow when running updates through Dataflow: Export all products via 'Export All Products' Dataflow profile. System -> Import/Export -> Dataflow - Profiles -> 'Export All ...
user avatar
  • 515
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 & ...
user avatar
  • 3,386
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 ...
user avatar
7 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 ...
user avatar
6 votes

Customer Grid - Add custom action

extend the select implement own controller do it I even have an alternative. The CSV export is based on the shown columns, so you can change the columns, e.h. while using GridControle to have your ...
user avatar
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/...
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. ...
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
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 ...
user avatar
  • 621
5 votes

"Product Type is invalid or not supported in rows" importing csv file

As of CE 1.9.0.1, only four product types can be imported using ImportExport: Simple Configurable Virtual Grouped These types and their import models are defined in the ImportExport config file. I'...
user avatar
5 votes

Importing Images via CSV in Magento

If you want to import images into Magento, use ImportExport with the following sample CSV: sku,_media_image,_media_attribute_id,_media_is_disabled,_media_position,_media_lable,image,small_image,...
user avatar
5 votes
Accepted

Import of product via CSV (need to update, not replace, not append)

You should use the "append" mode, but exclude everything from your CSV file which is already in the shop, i.e. the images. Only include the data you want to update and the SKU.
user avatar
5 votes

Remove var Translator = new Translate from <head> section

I have to agree with you that this is minimally not 'good' for SEO. Magento has to make sure that inline JS is made to a bare minimun. That this is inline JS is just lazy programming. We put this JS ...
user avatar
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 ...
user avatar
5 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 ...
user avatar
  • 559
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 ...
user avatar
  • 7,342
5 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 ...
user avatar
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 ...
user avatar
  • 1,372
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++...
user avatar
4 votes

How to add csv file in attributes

Here is how I would do it. Write a simple php script that transforms your csv into an installer script for adding attributes. Let's say your csv looks like this: code |label |type |input|...
user avatar
  • 195k
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 ...
user avatar

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