问题描述:

How to implement Attribute to find his own name in the admin area in Opencart : Products - Attributes - Attributes? Is that there is a separate field and simply by driving into the field and displays the name of the attribute is an attribute, as usual searching for items in the admin by name, but only with attribute

网友答案:

It's hard to understand what you are asking, but if you are trying to use attributes for products then you must first define them at catalog>attributes>attributes.

To List attributes in the Products tab you will need edit these files

admin>view>template>catalog>product_form.tpl
admin>controller>catalog>product.php

If your understanding of PHP or Opencart isn't very strong it will help you to copy data from the attribute.php controller to the product.php controller.

As for the search function, this is something I haven't done before but you could try using the search function on the front of the website as reference.

I recommend working through this as best you can then asking more questions if or when you get stuck.

*Update

Ok so since HTML is your strenth it will be smartest to start from there. Open any of these files (the ones that have the data you need).

admin>view>template>catalog>attribute_form.tpl
admin>view>template>catalog>attribute_group_form.tpl
admin>view>template>catalog>attribute_group_list.tpl
admin>view>template>catalog>attribute_list.tpl

Then work backwards with what you see. The tpl will show variables that look like $attribute, track these back to

admin>controller>catalog>attribute.php
admin>controller>catalog>attribute_group.php

And you will see how all the code is used to pull the data from the model and format it if necessary.

相关阅读:
Top