Conditions | 4 |
Paths | 5 |
Total Lines | 29 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function getAllOptions() |
||
14 | { |
||
15 | $attributes = Mage::getModel('eav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection(); |
||
16 | |||
17 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'hidden']); |
||
18 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'multiselect']); |
||
19 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'boolean']); |
||
20 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'date']); |
||
21 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'image']); |
||
22 | $attributes->addFieldToFilter('main_table.frontend_input', ['neq' => 'price']); |
||
23 | $attributes->addFieldToFilter('used_in_product_listing', '1'); |
||
24 | |||
25 | $attributes->setOrder('frontend_label', 'ASC'); |
||
26 | |||
27 | $_options = []; |
||
28 | |||
29 | $_options[] = [ |
||
30 | 'label' => Mage::helper('payture')->__('No usage'), |
||
31 | 'value' => 0 |
||
32 | ]; |
||
33 | |||
34 | foreach ($attributes as $attr) { |
||
35 | $label = $attr->getStoreLabel() ? $attr->getStoreLabel() : $attr->getFrontendLabel(); |
||
36 | if ('' != $label) { |
||
37 | $_options[] = ['label' => $label, 'value' => $attr->getAttributeCode()]; |
||
38 | } |
||
39 | } |
||
40 | return $_options; |
||
41 | } |
||
42 | |||
48 |