How the Magento 188.8.131.52 update affects Middle Name
First, the solution
I had the same issue when updating to Magento CE 184.108.40.206 from Magento CE 220.127.116.11. The update caused Middle Name to display, but when I checked the admin
System > Configuration > Customers > Customer Configuration > Name and Address Options the “Show Middle Name (initial)” setting was already displaying “No” — which is what I wanted. I changed the setting to “Yes” and then back to “No” before clicking “Save Config”, and this immediately removed Middle Name/Initial from Checkout when I refreshed the page.
In my case, I am working on updating a store from Magento 1.8.x to Magento 1.9.x. It is in my development environment that I updated from 18.104.22.168 to 22.214.171.124. In order to get the live site up-to-date when we launch the upgrade from 1.8.x to 1.9.x, we will need to update many of the admin settings, which we plan on doing directly in the database with a query. In the database you can see how Magento changes the Middle Name setting.
The displayed Admin setting can be misleading
The table `core_config_data` handles the admin setting for “Show Middle Name (initial) with the record where
This record holds the setting in the `value` field (0=”No”, 1=”Yes”). This field is not changed when the middle name appears by upgrading to Magento CE 126.96.36.199. If you save a change to the “Show Middle Name (initial)” in the admin settings after Magento makes changes during the update to 188.8.131.52, it will change the `core_config_data` value here.
The update to 184.108.40.206 did not change the record on `core_config_data`, and therefore what is displayed in the admin settings. But, the update does change a different record of a different table.
The actual middle name visiblity is in `customer_eav_attribute`
In my many dev instances of Magento, the table `eav_attribute` has 2 “middlename” `attribute_code`(s), the `attribute_id`(s) being 6 and 21. The `customer_eav_attribute` table sets the visibility of the attribute with a field `is_visible`.
- In my live 1.8.x environment, `attribute_id`(s) 6 and 21 had
`is_visible` = 0.
- After updating the dev to Magento CE 220.127.116.11 from Magento CE 18.104.22.168, it became
`is_visible` = 1.
- After I toggled and saved the admin “Show Middle Name (initial)” to “No”,
`is_visible`=0again and the Middle Name/Initial field disappeared from Checkout.
The Magento CE 22.214.171.124 update flipped the Middle Name setting in the `customer_eav_attribute` table without affecting what is displayed in the Magento admin under the “Show Middle Name (Initial)” setting. You can fix it the way the setting is normally adjusted in the admin, without making far reaching template adjustments, by toggling the “Show Middle Name (Initial)” setting.
If for some reason you need to transfer this admin setting across multiple copies of a store, or in a batch of admin updates, like while upgrading a store to match a dev environment… You can use the following SQL statement for this setting (provided you know that “middlename” is `attribute_id` 6 and 21 in your store. This is standard to Magento, but to be safe, double-check your `eav_attribute` table first.).
[code]UPDATE customer_eav_attribute SET is_visible = 0 WHERE attribute_id IN (6, 21);[/code]
Mungkin anda juga tertarik: