Note: This article is for situations where the Magento property set (attribute sets) and properties are added to the program in bulk. This problem is not true if the background is manually added.
For example, the import format for CSV files is:
The code is as follows |
Copy Code |
"SKU", "store",...., "Myselect" "Sku1", "admin",...., "value1" "Sku2", "admin",...., "Value3" |
Here the Myselect is a new attribute for Magento, a drop-down filter Select
Unlike the CSV file format using Magento's own importer specification, you need to change the "value1" "Value3" If you use MAMGI import ..., the ID of the option for the corresponding property field.
You can use the Magento code to query and replace:
The code is as follows |
Copy Code |
$productModel = Mage::getmodel (' catalog/product '); $attr = $productModel->getresource ()->getattribute ("Myselect"); if ($attr->usessource ()) { $value _id = $attr->getsource ()->getoptionid ("value1"); } |
Here the value of the value_id replaces the "value1" with the MAMGI import again.