28

I've done this to export all attributes and their options (if it is a dropdown attribute) from the source website: exportAttributes.php in root directory of source website: <?php define('MAGENTO', realpath(dirname(__FILE__))); require_once MAGENTO . '/app/Mage.php'; Mage::app(); $entity_type_id = Mage::getModel('catalog/product')->getResource()->...


22

If your var/importexportxxx file is blank try; php bin/magento queue:consumers:start exportProcessor https://github.com/magento/magento2/issues/23450


19

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(__('...


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

note: I get crystal clear explanation of custom import option from this link Please first download the whole zip file from this github link then change the module name as per your requirement. Just alter the two files is enough to import your custom CSV to custom table. step1: alter app/code/vendor/module_name/etc/import.xml from your download github ...


17

In short: Don't use Dataflow for anything, it's deprecated. Yoav Kutner once (2011) said that Dataflow is not usable, and that was the reason they added ImportExport in Magento 1.5. The main disadvantage of Dataflow is its very low speed. ImportExport is much faster. It's not perfect as its CSV format is not too intuitive (I have summarized it at http://...


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


14

That looks like they tried to make sure to destroy the image resource, but instead introduced a memory leak. I cannot think of a valid reason for this code, to be honest, but I can explain what has been changed: Originally, imagedestroy() would have been called in the desctructor __destruct() function __destruct() { @imagedestroy($this->...


11

Found it: The column is actually still there, but is titled product_online (the attribute status has not changed though)


11

You have to run cron by command line as mentioned here: php bin/magento cron:run https://github.com/magento/magento2/issues/23450#issuecomment-507581035 Then refresh the export page and you should see the file at the bottom.


10

you can try like below with latest created_at $collection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSort('created_at', 'desc'); $collection->getSelect()->limit(1); EDIT echo $latestItemId = $collection->getLastItem()->getId(); exit; hope ...


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 ...


8

There are two options for this. It's more comfortable to use nested arrays (see http://avstudnitz.github.io/AvS_FastSimpleImport/options.html: "Support Nested Arrays for Import"), you can then use arrays inside the media* attributes like this: '_media_attribute_id' => array(77, 77, 77), '_media_image' => array('img1.jpg', 'img2.jpg', 'img3.jpg', '...


8

I would suggest to extend the Magento 2's default import functionality. To do that register a new module (lets say "Custom Import" for now) Create a module.xml file at app/code/Foo/CustomImport/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


8

The problem is that $order is not set or it's no object (of type Mage_Sales_Model_Order). Also order with downloadable products have no shipping address. Edit: For the updated questions ... make sure loaded $order is valid. It seems the order you're are trying to load isn't correct.^ Use entity_id $order = Mage::getModel('sales/order')->load(19); ...


7

Make sure you have reindexed all the indexes or your customer grid would not show imported customers. Use following command. php bin/magento indexer:reindex EDIT : Note that if you're only not able to see the customer in admin you can also run; php bin/magento indexer:reindex customer_grid this will reindex corresponding to customer grid only and ...


6

Try this: $collection = Mage::getResourceModel('catalog/product_collection'); $collection->addAttributeToSort('entity_id', 'DESC'); $collection->setPage(1,1); //set a limit to 1 so the query would be faster echo $collection->getFirstItem()->getId();


6

I'm not 100 sure but I think it has something to do with the status or visibility or the product. In the products grid, when retrieving the collection there are 2 inner joins for selecting the status and visibility. (actually there is a third one, for the name but I doubt this is the problem). If there are no values for visibility and status the product does ...


6

Having the same problems with my Magento 1.9.2.0... I only get this to work by changing Varien_Image_Adapter_Gd2 in /lib/Varien/Image/Adapter/Gd2.php as follows: public function __construct() { // Initialize shutdown function // register_shutdown_function(array($this, 'destruct')); } /** * Destroy object image on shutdown */ public function ...


6

go to Admin > catalog > products select all products select action as update attributes you have to check short description checkbox with empty text there. save. please select short description as not required attribute. re-index and clear cache after remove. You can use this trick for any admin product mass Field update. I hope this will help ...


6

All custom attributes get appeared under "additional_attributes" header in the export separated by a comma (,). I am using Magento 2.0.7. To make these attributes occupy a separate cell, we can add more columns to the CSV.


6

I found a free Magento 2 extension from BSS Commerce which helped me work around this: https://bsscommerce.com/blog/how-to-export-custom-product-attributes-in-magento-2/ https://bsscommerce.com/custom-product-attribute-export-for-magento-2.html It provides some override code for the Model\Export\Product core class which breaks out the ...


6

This is possible by following the below steps; Include export.xml in your module etc directory with a content similar to the below; <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="manufacturer" label="Manufacturer ...


5

In Admin Panel, i) Goto Manage Products ii) Then Select the products which are not displaying in the frontend iii) Then Select the Update Attributes in the Action iv) Then Add those products to correct websites. Re-index the catalog products. Hope this will help you.


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

It was part of fixing security issues with unserialize. Magic methods like __destruct have inherent issues with serialization. We have seen exploits proposed that were using serialization and __destruct to create files in the file system - and this change (you will see more similar changes in other places) was done to avoid this. Does it cause memory ...


5

So I did raise a bug with Magento including a "solution" that should deal with the memory usage issues in the image import process. The solution can be found on github under https://github.com/sitewards/import_image_memory_leak_fix but the basic idea is. Fixing the Mage_Catalog_Helper_Image::validateUploadFile to actually call the destruct method on the ...


5

Solution : For this Need to do some changes in vendor\magento\module-catalog-import-export\Model\Export\Product.php file or override same model file in your custom module . In vendor\magento\module-catalog-import-export\Model\Export\Product.php file add custom_attributes code those you want in separate cell ( not in additional_attributes cell) in $...


5

Yes, for custom attributes you have to use the additional_attributes column. Unfortunately you cannot add columns to the CSV anymore.


5

You can used below code to update product attributes for all store Added $ for obj $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->create('\Magento\Store\Model\StoreManagerInterface'); $storeIds = array_keys($storeManager->getStores()); $action = $objectManager->create('\Magento\Catalog\Model\...


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