Reorder Attributes in Magento Advanced Search Page

I have several custom attributes for my products in Magento, and they are searchable on the Magento search page; the problem is that the fields are listed in the wrong order on the search page;

For instance:

Title _____
Author _____
SKU _____
ISBN _____

Must be:

Author _____
Title _____
ISBN _____
SKU _____

I looked at the template file and it seems to output an array (or object) from it from an internal order. I would like to know how to change this order :).

Any (relatively direct) ideas?

+3
source share
3 answers

, (catalogsearch\advanced\form.phtmlMage_CatalogSearch_Block_Advanced_Form), , getAttributes Mage_CatalogSearch_Model_Advanced, , , :

$attributes = Mage::getResourceModel('catalog/product_attribute_collection')
            ...
            ->setOrder('main_table.attribute_id', 'asc')
            ->load();

, attribute_id eav_attribute, .

catalog_eav_attribute additional_table, , , ->setOrder('additional_table.position', 'asc'), "" phpMyAdmin.

, Mage_CatalogSearch_Model_Advanced app/code/local/Mage/CatalogSearch/Model .

SQL-, $_debug $_logAllQueries lib/varien/Db/Adapter/Pdo/Mysql.php. !

, , JD

+6

Magento 1.7x .

- > → ---

, .

+2

?

→ → → → →

Edit:

, , / .

, , : http://alanstorm.com/category/magento

0

Source: https://habr.com/ru/post/1762375/


All Articles