/** * Test default accessors for basic Magento components. */ public function test_defaults() { $helper = Praxigento_Quickorder_Config::helper(); $this->assertTrue($helper instanceof Mage_Core_Helper_Abstract); $rsrc = Praxigento_Quickorder_Config::getResourceSuggestion(); $this->assertTrue($rsrc instanceof Praxigento_Quickorder_Model_Mysql4_Suggestion); }
/** * Create suggestion according to customer's query. */ public function suggestionAction() { $this->loadLayout(); // parse request params and select products to suggestion $formQuery = $this->getRequest()->getParam(Praxigento_Quickorder_Config::REQ_PARAM_QUERY); $collection = null; if ($formQuery) { $model = Praxigento_Quickorder_Config::getResourceSuggestion()->setQuery($formQuery); $collection = $model->getProductCollection(); } // prepare block to display $block = $this->getLayout()->getBlock(Praxigento_Quickorder_Config::UI_BLOCK_SUGGESTION); $block->setProductCollection($collection); $block->setData(Praxigento_Quickorder_Config::REQ_PARAM_QUERY, $formQuery); $block->setTemplate(Praxigento_Quickorder_Config::UI_TMPL_SUGGESTION); // $this->renderLayout(); }