add attribute in product information -> Inventory

2019-07-08 20:32发布

问题:

Hey, I just realise how easy is to add attributes to the form products in ADMIN, and its working perfectly. So similarly to setting attributes for General, Prices, Meta Information, Images, Recurring Profiles, Design and More Information, how can I add an attribute to Inventory form?

Thanks in advance for any help.

回答1:

For me (in Magento v 1.3.2.4) creating attributes the usual way (Catalog>Attributes>Manage Attributes) didn’t work in this case, as the value for that attribute didn’t get saved. In order to be able to save it I had to create this attribute in database table ”cataloginventory_stock_item”.

Only then the value is saved for each product.



回答2:

Unfortunately, the Inventory form is not dynamic like others, and you can't just add an attribute to this form.

If you are good with Magento programming, than you can play with it's block: app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php

and with it's template: app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml