Import Magento Filtered Select property fields with MAMGI note

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.