Hot answers tagged

18

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() because you just want to load Magento, not run it. // load all of the active categories in the system and include all attributes $categories = Mage::getModel('...


18

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 your controller path public function import($file) { if (!isset($file['tmp_name'])) throw new \Magento\Framework\Exception\LocalizedException(__('...


17

you have to double the quotes in your language file. "Check ""Remember Me"" to access","Check ""Remember Me"" to access" | \| \| | | | | | | |------------| | | | | | will be | | transformed | | to one " ...


15

First you have to upload alll the images you want to import in the media/import/yourimagesfolder/ The in the CSV columns for image, thumbnail and small_image your image path should look like this /yourimagefolder/imagename.jpg


12

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 hands, in case here is the list of default attributes: color cost country_of_manufacture custom_design custom_design_from custom_design_to custom_layout_update ...


11

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' => 'email_address1', 'width' => '60', 'type' => 'text', 'is_system' => true, 'filter_index' => 'email_address1' ...


10

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 still face the issue then un-check Fields enclosure checkbox.


9

Surprised no answers with so many votes/views, so I'll bite: This would be dependant on the old POS system, massage the data during import. Familiarize yourself with Varien_Io, particularly Varien_Io_File. Since you'll most likely be dealing with such a large collection of data, keep in mind to use streams such as StreamReadCsv and StreamWriteCsv. More ...


9

First, unfortunately Magento doesn't import the files generated by it's export. AFAIK, this is true for both import/export module and default out-of-box dataflow profiles. Second, I'll try to bring more light on images question as I see for many it's unclear how it works: When you import, it expects that images are placed in media/import. So if you have a ...


9

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 (Exception $e) { Mage::log('Csv: ' . $file . ' - getCsvData() error - '. $e->getMessage(), Zend_Log::ERR, 'exception.log', true); return false; ...


9

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 dynamically renders the image, so you should supply the highest quality JPG you can (set quality to maximum when exporting from Photoshop or similar). If you are ...


8

Try Following way, <?php protected $filesystem; protected $directoryList; protected $csvProcessor; public function __construct( \Magento\Framework\File\Csv $csvProcessor, \Magento\Framework\App\Filesystem\DirectoryList $directoryList, \Magento\Framework\Filesystem $filesystem ) { $this->filesystem = $filesystem; $this->...


7

Import using Magento's System > Import/Export > Dataflow Profiles. Make a comma-delimitted list of category_ids with sku as the key. Save it out as a CSV file: sku,category_ids ABC123,"1,2,3,4,5,7" A3K23,"7,8,6,5" When imported with Dataflow, the category_ids for the skus will be replaced with the categories as listed above so make sure you catch all ...


7

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 Products' -> Run Profile -> Run Profile in Popup Edit the exported file, updating the information you require (The exported file location by default is '...


7

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 & children skus) related.csv file in var folder, with comma as csv separator, and pipe as children_skus separator This are the files, if you want to try. You'd replace ...


7

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 computer when you are logged out","Check &quot;Remember Me&quot; to access your shopping cart on this computer when you are logged out" So you need to ...


6

Ah hah! According to the Apache error log: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 84 bytes) in /Zend/Db/Statement/Pdo.php on line 290 So apparently Magento needs over 256MB of memory to export customers. OK the store in question has about 20,000 customers but that still sounds like quite a lot. Plus, this ...


6

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 export, then you get what you want.


6

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/Import/Download.php /** * Download sample file action * * @return \Magento\Framework\Controller\Result\Raw */ public function execute() { ...... $...


6

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. In my example I have added sample data in function. $fileSize is optional parameter so i skip it. public function execute() { ...... $heads = "Col1,...


6

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


6

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 in the following way into the column with the name additional_attributes_code into your imported CSV file. custom_attribute_code_1="Value_1",...


6

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 ts_dimensions_width ts_dimensions_height


5

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'm afraid you would have to write your own import adapter for downloadable products.


5

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,thumbnail 1234567,img1.jpg,77,1,1,Image 1,img1.jpg,img2.jpg,img2.jpg ,img2.jpg,77,0,2,Image 2,,, ,img3.jpg,77,0,3,Image 3,,, The files must be in /media/import/...


5

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.


5

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 in a separate js file. To do this follow these instructions: Go to a random page and find (chrome: right click > view source) the JS with this var: var ...


5

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 import. It is not the best because you need to reload attribute option cache for each line. If you found some optimization, please share it. Solution: Create a ...


5

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 with 2 columns is the CSV required for each module. That's why module name is not specified in it. This file is located under i18n folder of each module.


5

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 file. There are many another way to download CSV file using Core PHP script but its not best way to use within Magento Coding standard. You can write CSV and ...


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