pickles/common/modules/store/category.php
Josh Sherman c6af785100 Latest and greatest.
git-svn-id: http://svn.cleancode.org/svn/pickles@85 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-12-31 02:45:40 +00:00

26 lines
498 B
PHP

<?php
class store_category extends store {
protected $display = DISPLAY_SMARTY;
public function __default() {
$category = $this->db->getRow("
SELECT id, name, permalink, description
FROM categories
WHERE permalink = '{$_REQUEST['permalink']}';
");
$this->category = $category;
$this->products = $this->db->getArray("
SELECT p.*
FROM products AS p
INNER JOIN category_xref as c
ON p.id = c.product_id
WHERE c.category_id = '{$category['id']}';
");
}
}
?>