public function __construct($config = array()) { parent::__construct($config); $this->tax = new K2StoreTax(); //language $language = JFactory::getLanguage(); /* Set the base directory for the language */ $base_dir = JPATH_SITE; /* Load the language. IMPORTANT Becase we use ajax to load cart */ $language->load('com_k2store', $base_dir, $language->getTag(), true); }
function display() { switch ($this->getTask()) { case 'edit': JRequest::setVar('hidemainmenu', 1); JRequest::setVar('layout', 'form'); JRequest::setVar('view', 'address'); JRequest::setVar('edit', true); $model = $this->getModel('address'); break; } parent::display(); }
function display($cachable = false, $urlparams = array()) { switch ($this->getTask()) { case 'add': JRequest::setVar('hidemainmenu', 1); JRequest::setVar('layout', 'edit'); JRequest::setVar('view', 'option'); JRequest::setVar('edit', false); break; case 'edit': JRequest::setVar('hidemainmenu', 1); JRequest::setVar('layout', 'edit'); JRequest::setVar('view', 'option'); JRequest::setVar('edit', true); break; } parent::display(); }
function __construct() { parent::__construct(); JFactory::getDocument()->setCharset('utf-8'); $this->params = JComponentHelper::getParams($this->option); // $this->defaultShippingMethod = $this->params->get('defaultShippingMethod', '1'); // create the order object $this->_order = JTable::getInstance('Orders', 'Table'); //initialise tax class $this->tax = new K2StoreTax(); //initialise the session object $this->session = JFactory::getSession(); //language $language = JFactory::getLanguage(); /* Set the base directory for the language */ $base_dir = JPATH_SITE; /* Load the language. IMPORTANT Becase we use ajax to load cart */ $language->load($this->option, $base_dir, $language->getTag(), true); }
function display($cachable = false, $urlparams = array()) { $app = JFactory::getApplication(); switch ($this->getTask()) { case 'add': $msg = JText::_('K2STORE_AVAILABLE_IN_PRO_VERSION'); $link = 'index.php?option=com_k2store&view=fields'; $this->setRedirect($link, $msg); break; case 'edit': $app->input->set('hidemainmenu', 1); $app->input->set('layout', 'edit'); $app->input->set('view', 'field'); $app->input->set('edit', true); JRequest::setVar('view', 'field'); JRequest::setVar('layout', 'edit'); break; } parent::display($cachable = false, $urlparams = array()); }
function display() { JRequest::setVar('view', 'addresses'); parent::display(); }
function __construct() { parent::__construct(); }
/** * Will execute a task within a shipping plugin * * (non-PHPdoc) * @see application/component/JController::execute() */ function execute($task) { $app = JFactory::getApplication(); $shippingTask = $app->input->getCmd('shippingTask', ''); $values = $app->input->getArray($_POST); //print_r($values); // Check if we are in a shipping method view. If it is so, // Try lo load the shipping plugin controller (if any) if ($task == "view" && $shippingTask != '') { $model = $this->getModel('Shipping', 'K2StoreModel'); $id = $app->input->getInt('id', '0'); if (!$id) { parent::execute($task); } $model->setId($id); // get the data // not using getItem here to enable ->checkout (which requires JTable object) $row = $model->getTable(); $row->load((int) $model->getId()); $element = $row->element; // The name of the Shipping Controller should be the same of the $_element name, // without the shipping_ prefix and with the first letter Uppercase, and should // be placed into a controller.php file inside the root of the plugin // Ex: shipping_standard => K2StoreControllerShippingStandard in shipping_standard/controller.php $controllerName = str_ireplace('shipping_', '', $element); $controllerName = ucfirst($controllerName); $path = JPATH_SITE . '/plugins/k2store/'; $controllerPath = $path . $element . '/' . $element . '/controller.php'; if (file_exists($controllerPath)) { require_once $controllerPath; } else { $controllerName = ''; } $className = 'K2StoreControllerShipping' . $controllerName; if ($controllerName != '' && class_exists($className)) { // Create the controller $controller = new $className(); // Add the view Path $controller->addViewPath($path); // Perform the requested task $controller->execute($shippingTask); // Redirect if set by the controller $controller->redirect(); } else { parent::execute($task); } } else { parent::execute($task); } }
function display($cachable = false, $urlparams = array()) { JRequest::setVar('view', 'cpanel'); parent::display($cachable = false, $urlparams = array()); }
/** * Overrides the delete method, to include the custom models and tables. */ public function delete() { $this->includeCustomModel('ShippingRates'); $this->includeCustomTables(); parent::delete(); }
function __construct() { JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2store' . DS . 'tables'); parent::__construct(); }
function __construct($config = array()) { parent::__construct($config); }