Magento: sort products by attribute position -
in site have setted filter ordering products attribute, order alphabetical , order position attribute setted in backend.
example attribute color:
valuename | position
green | 1
blue | 2
red | 3
the actual result in frontend product blue green red, result green blue red
what classes can modify resolving problem?
thanks in advance
i thinking create custom option product , set short_order of value. if right use code.
go app/code/core/mage/catalog/model/product/option.php
there function getproductoptioncollection line no:- 373 . comment out code of ->setorder('title', 'asc'); , add " ; " after ->setorder('sort_order', 'asc')
public function getproductoptioncollection(mage_catalog_model_product $product) { $collection = $this->getcollection() ->addfieldtofilter('product_id', $product->getid()) ->addtitletoresult($product->getstoreid()) ->addpricetoresult($product->getstoreid()) ->setorder('sort_order', 'asc'); //->setorder('title', 'asc'); if ($this->getaddrequiredfilter()) { $collection->addrequiredfilter($this->getaddrequiredfiltervalue()); } $collection->addvaluestoresult($product->getstoreid()); return $collection; }
Comments
Post a Comment