/** * Displays a product's options. * * @param int $product_id Product ID. * * @return void */ public function action_index($product_id = null) { $product = $this->get_product($product_id); $options = Service_Product_Option::find(array('product' => $product)); $this->view->product = $product; $this->view->options = $options; }
/** * Gets one or more product options. * * @param int $product_id Product ID. * @param int $id Product option ID. * * @return void */ public function get_index($product_id = null, $id = null) { $product = $this->get_product($product_id); if (!$id) { $options = \Service_Product_Option::find(array('product' => $product)); } else { $options = $this->get_option($id, $product); } $this->response($options); }