Update product category view to include default price_display configured by category

This commit is contained in:
Deon George
2013-01-11 13:33:57 +11:00
parent f08215717c
commit 3fa1ca3665
6 changed files with 88 additions and 53 deletions

View File

@@ -30,6 +30,20 @@ class Model_Product_Category extends ORM_OSB {
return ($a=$this->product_category_translate->where('language_id','=',$ao->language_id)->find()->description) ? $a : _('No Description');
}
/**
* List all the products belonging to this cateogry
* @todo Consider if we should cache this
*/
public function products() {
$return = array();
foreach (ORM::factory('Product')->where_active()->find_all() as $po)
if (in_array($this->id,$po->categories()))
array_push($return,$po);
return $return;
}
public function list_bylistgroup($cat) {
$result = array();