Add a product refers to one-or-many distributors in Magento [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI am using Magento
to build a bookshop
A book includes:
- has many attributes such as: name, prices, w开发者_开发知识库eight, etc...
- belong to one publisher
- belong to one-or-many categories
- has many
distributors
which includes many attributes:- name
- address
- phone/email
So, when I create a book in Admin Management Panel, how I could:
- Make a list of
distributors
. - Add a book (product) refer to
one-or-many
distributors
?
Make a multiselect attribute called distributors. This will give you the possibility of adding one or multiple distributors to products. However, the attribute options only have IDs, label fields, and nothing else.
To extend this, you will need to write you own module with a database table containing your fields and a reference to the attribute option:
- Distributor ID (reference to option_id in eav_attribute_option)
- Name
- Address
- Phone
You will probably also need to write a backend interface for editing this data, and some functions to access distributor data by attribute option ID etc.
精彩评论