/** * Function used to update * * @param INT $called_frm //Mundhe complet this * * @return Array * * @since 1.0.0 */ public function update_mod($called_frm = '0') { $lang = JFactory::getLanguage(); $lang->load('mod_quick2cart', JPATH_ROOT); $comquick2cartHelper = new comquick2cartHelper(); jimport('joomla.application.module.helper'); if (JModuleHelper::getModule('mod_quick2cart')) { $module = JModuleHelper::getModule('mod_quick2cart'); if (JVERSION < '1.6.0') { $moduleParams = new JParameter($module->params); $layout = $moduleParams->get('viewtype'); $ckout_text = $moduleParams->get('checkout_text'); } else { $moduleParams = json_decode($module->params); if (!empty($moduleParams)) { $layout = $moduleParams->viewtype; $ckout_text = $moduleParams->checkout_text; } } } if (isset($layout) && isset($ckout_text)) { $data = $comquick2cartHelper->get_module($layout, $ckout_text); } else { $data = $comquick2cartHelper->get_module(); } echo $data; jexit(); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $app = JFactory::getApplication(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_quick2cart'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } // Get user store list $storeHelper = new storeHelper(); // Get all stores. $user = JFactory::getUser(); $this->userStores = $storeHelper->getUserStore($user->id); // Get toolbar path $comquick2cartHelper = new comquick2cartHelper(); $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); // Publish states $this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED')); // Setup TJ toolbar $this->addTJtoolbar(); $this->_prepareDocument(); parent::display($tpl); }
/** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JController * @since 1.6 */ public function __construct($config = array()) { $comquick2cartHelper = new comquick2cartHelper(); $this->my_stores_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=stores&layout=my'); $this->create_store_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore'); parent::__construct($config); }
/** * Display the view */ public function display($tpl = null) { $comquick2cartHelper = new comquick2cartHelper(); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $app = JFactory::getApplication(); $user = JFactory::getUser(); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_quick2cart'); $this->form = $this->get('Form'); if (!empty($this->item->zone_id)) { $zoneDetail = $zoneHelper->getZoneDetail($this->item->zone_id); // Check whether user is authorized for this zone ? if (!empty($zoneDetail['store_id'])) { $status = $comquick2cartHelper->store_authorize('taxrateform_default', $zoneDetail['store_id']); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
function getInput() { $lang = JFactory::getLanguage(); $lang->load('com_quick2cart', JPATH_ADMINISTRATOR); $fieldName = $this->fieldname; JHtml::_('behavior.modal', 'a.modal'); $html = ''; $client = "com_content"; $jinput = JFactory::getApplication()->input; // $pid=$jinput->get('id'); $isAdmin = JFactory::getApplication()->isAdmin(); if (!$isAdmin) { $pid = $jinput->get('a_id'); } else { $pid = $jinput->get('id'); } // CHECK for view override $comquick2cartHelper = new comquick2cartHelper(); $path = $comquick2cartHelper->getViewpath('attributes', '', "ADMIN", "SITE"); ob_start(); include $path; $html = ob_get_contents(); ob_end_clean(); return $html; }
/** * Display the view */ public function display($tpl = null) { $this->params = JComponentHelper::getParams('com_quick2cart'); $comquick2cartHelper = new comquick2cartHelper(); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $qtcshiphelper = new qtcshiphelper(); $app = JFactory::getApplication(); $jinput = $app->input; $user = JFactory::getUser(); $layout = $jinput->get('layout', 'default'); $model = $this->getModel('shipprofileform'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } if ($layout == 'default') { $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->form = $this->get('Form'); // Check whether user is authorized for this zone ? if (!empty($this->item->store_id)) { $status = $comquick2cartHelper->store_authorize('shipprofileform_default', $this->item->store_id); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } // Get store name while edit view if (!empty($this->item->id) && !empty($this->item->store_id)) { $comquick2cartHelper = new comquick2cartHelper(); $this->storeDetails = $comquick2cartHelper->getSoreInfo($this->item->store_id); $this->shipPluglist = $model->getShipPluginListSelect(); } // Get shipping profile_id $shipprofile_id = $app->input->get('id', 0); // Getting saved tax rules. if (!empty($shipprofile_id)) { $this->shipMethods = $model->getShipMethods($shipprofile_id); } } else { $this->qtcShipProfileId = $jinput->get('id'); $this->shipmethId = $jinput->get('shipmethId', 0); $shipProfileDetail = $this->shipProfileDetail = $qtcshiphelper->getShipProfileDetail($this->qtcShipProfileId); // Getting saved tax rules. if (!empty($this->shipmethId) && !empty($shipProfileDetail['store_id'])) { // GET PLUGIN DETAIL $this->plgDetail = $qtcshiphelper->getPluginDetailByShipMethId($this->shipmethId); $this->shipPluglist = $model->getShipPluginListSelect($this->plgDetail['extension_id']); // Get plugin shipping methods $qtcshiphelper = new qtcshiphelper(); $this->response = $qtcshiphelper->qtcLoadShipPlgMethods($this->plgDetail['extension_id'], $shipProfileDetail['store_id'], $this->plgDetail['methodId']); } } $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = JComponentHelper::getParams('com_quick2cart'); // Check for errors. $errors = $this->get('Errors'); if (count($errors)) { throw new Exception(implode("\n", $errors)); } // Creating status filter. $statuses = array(); $statuses[] = JHtml::_('select.option', '', JText::_('COM_QUICK2CART_SELONE')); $statuses[] = JHtml::_('select.option', 1, JText::_('COM_QUICK2CART_PUBLISH')); $statuses[] = JHtml::_('select.option', 0, JText::_('COM_QUICK2CART_UNPUBLISH')); $this->statuses = $statuses; // Get itemid $comquick2cartHelper = new comquick2cartHelper(); $this->createstore_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore'); // Get toolbar path $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); // Get other vars $storeHelper = new storeHelper(); $this->allowToCreateStore = $storeHelper->isAllowedToCreateNewStore(); // Setup toolbar $this->addTJtoolbar(); $this->_prepareDocument(); parent::display($tpl); }
/** * Fetch custom Element view. * * @param string $name Field Name. * @param mixed $value Field value. * @param mixed $node Field node. * @param mixed $control_name Field control_name/Id. * * @since 2.2 * @return null */ public function fetchElement($name, $value, $node, $control_name) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $comquick2cartHelper = new comquick2cartHelper(); // Getting user accessible store ids $storeList = $comquick2cartHelper->getStoreIds(); $options = array(); $app = JFactory::getApplication(); $jinput = $app->input; $zone_id = $jinput->get('id'); $defaultSstore_id = 0; if ($zone_id) { // Load Zone helper. $path = JPATH_SITE . DS . "components" . DS . "com_quick2cart" . DS . 'helpers' . DS . "zoneHelper.php"; if (!class_exists('zoneHelper')) { JLoader::register('zoneHelper', $path); JLoader::load('zoneHelper'); } $zoneHelper = new zoneHelper(); $defaultSstore_id = $zoneHelper->getZoneStoreId($zone_id); } foreach ($storeList as $store) { $storename = ucfirst($store['title']); $options[] = JHtml::_('select.option', $store['store_id'], $storename); } $fieldName = $name; return JHtml::_('select.genericlist', $options, $fieldName, 'class="inputbox required" size="1" ', 'value', 'text', $defaultSstore_id, $control_name); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { //$this->state = $this->get('State'); $this->item = $this->get('Item'); //$this->form = $this->get('Form'); $comquick2cartHelper = new comquick2cartHelper(); $getPayoutFormData = $this->get('PayoutFormData'); $this->getPayoutFormData = $getPayoutFormData; //print_r($this->getPayoutFormData);die; $payee_options = array(); $payee_options[] = JHtml::_('select.option', '0', JText::_('COM_QUICK2CART_SELECT_PAYEE')); if (!empty($getPayoutFormData)) { foreach ($getPayoutFormData as $payout) { $amt = round($payout->total_amount); if ($amt > 0) { $username = $comquick2cartHelper->getUserName($payout->user_id); $payee_options[] = JHtml::_('select.option', $payout->user_id, $username); } } } $this->payee_options = $payee_options; // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->addToolbar(); parent::display($tpl); }
/** * Class constructor. * * @param array $config A named array of configuration variables. * * @since 1.6 */ public function __construct($config = array()) { $comquick2cartHelper = new comquick2cartHelper(); $this->my_coupons_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=coupons&layout=my'); $this->create_coupon_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=couponform'); parent::__construct($config); $this->view_list = 'coupons'; }
/** * Gives sales reports csv export. * * @since 2.2.2 * @return null. */ public function csvexport() { $model = $this->getModel("salesreport"); $CSVData = $model->getCsvexportData(); $filename = "SalesReport_" . date("Y-m-d"); $csvDataString = null; $headColumn = array(); $headColumn[0] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ITEMID'); $headColumn[1] = JText::_('COM_QUICK2CART_SALESREPORT_PROD_NAME'); $headColumn[2] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_NAME'); $headColumn[3] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ID'); $headColumn[4] = JText::_('COM_QUICK2CART_SALESREPORT_SALES_COUNT'); $headColumn[5] = JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT'); $headColumn[6] = JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY'); $csvDataString .= implode(";", $headColumn); $csvDataString .= "\n"; header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header("Content-disposition: filename=" . $filename . ".csv"); // Getting all store list $comquick2cartHelper = new comquick2cartHelper(); $store_details = $comquick2cartHelper->getAllStoreDetails(); $productHelper = new productHelper(); if (!empty($CSVData)) { foreach ($CSVData as $data) { $store_id = $data['store_id']; $csvrow = array(); $csvrow[0] = '"' . $data['item_id'] . '"'; $csvrow[1] = '"' . $data['item_name'] . '"'; $csvrow[2] = '""'; if (!empty($store_details[$store_id])) { $csvrow[2] = '"' . $store_details[$store_id]['title'] . '"'; } $csvrow[3] = '"' . $data['store_id'] . '"'; $csvrow[4] = '"' . $data['saleqty'] . '"'; // GETTING PRODUCT PRICE $prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($data['item_id']); // CONSIDERING FIELD DISCOUNT, NOT COUPON DISCOUNT $discountPrice = $prodAttDetails['itemdetail']['discount_price']; $prodBasePrice = !empty($discountPrice) ? $discountPrice : $prodAttDetails['itemdetail']['price']; $prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price']; $prodPrice = strip_tags($comquick2cartHelper->getFromattedPrice($prodPrice)); $csvrow[5] = '"' . $prodPrice . '"'; $csvrow[6] = '""'; if (!empty($store_details[$store_id])) { $csvrow[6] = '"' . $store_details[$store_id]['firstname'] . '"'; } $csvDataString .= implode(";", $csvrow); $csvDataString .= "\n"; } } ob_clean(); echo $csvDataString . "\n"; jexit(); $link = 'index.php?option=com_quick2cart&view=salesreport'; $this->setRedirect($link); }
function display($tpl = null) { global $mainframe, $option; $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = $jinput->get('option'); //default layout is default $layout = $jinput->get('layout', 'payouts', 'STRING'); $this->setLayout($layout); //set toolbar $this->_setToolBar(); $filter_order_Dir = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $filter_type = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order', 'filter_order', 'id', 'int'); if ($layout == 'payouts') { $payouts = $this->get('Payouts'); $this->payouts = $payouts; $total = $this->get('Total'); // use for pagination $this->total = $total; $pagination = $this->get('Pagination'); $this->pagination = $pagination; } if ($layout == 'edit_payout') { $comquick2cartHelper = new comquick2cartHelper(); $getPayoutFormData = $this->get('PayoutFormData'); $this->getPayoutFormData = $getPayoutFormData; $payee_options = array(); $payee_options[] = JHtml::_('select.option', '0', JText::_('Select payee')); if (!empty($getPayoutFormData)) { foreach ($getPayoutFormData as $payout) { $amt = round($payout->total_amount); if ($amt > 0) { $username = $comquick2cartHelper->getUserName($payout->user_id); $payee_options[] = JHtml::_('select.option', $payout->user_id, $username); } } } $this->payee_options = $payee_options; $task = $jinput->get('task'); $this->task = 'reports.' . $task; $payout_data = array(); if ($task == 'edit_pay') { $payout_data = $this->get('SinglePayoutData'); } $this->assignRef('payout_data', $payout_data); } $payee_name = $mainframe->getUserStateFromRequest('com_quick2cart', 'payee_name', '', 'string'); // $lists['payee_name']=$payee_name; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_type; $this->lists = $lists; // FOR DISPLAY SIDE FILTER if (JVERSION >= 3.0) { $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); if (!$user->id) { ?> <div class="<?php echo Q2C_WRAPPER_CLASS; ?> my-coupons"> <div class="well" > <div class="alert alert-error"> <span><?php echo JText::_('QTC_LOGIN'); ?> </span> </div> </div> </div> <?php return false; } $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_quick2cart'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED')); // Get toolbar path $comquick2cartHelper = new comquick2cartHelper(); $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); // get store id (list))from model and pass to getManagecoupon() $this->store_role_list = $store_role_list = $comquick2cartHelper->getStoreIds(); if ($this->store_role_list) { $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : $store_role_list[0]['store_id']; $this->selected_store = $store_id; if ($this->store_id) { //$this->authorized_store_id= storeid of user $this->authorized_store_id = $authorized_store_id = $comquick2cartHelper->createCouponAuthority($store_id); } } // Setup TJ toolbar $this->addTJtoolbar(); $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $zoneHelper = new zoneHelper(); $comquick2cartHelper = new comquick2cartHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible('zoneform', "default", 'form')) { return; } $app = JFactory::getApplication(); $previousId = JFactory::getApplication()->input->get('id'); $user = JFactory::getUser(); $jinput = $app->input; $layout = $jinput->get('layout', ''); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_quick2cart'); $this->form = $this->get('Form'); $model = $this->getModel('zoneform'); if ($this->item) { // Getting countries $country = $model->getCountry(); $this->country = $country; // Getting zone rules $this->geozonerules = $model->getZoneRules(); // Check whether user is authorized for this zone ? if (!empty($this->item->store_id)) { $status = $comquick2cartHelper->store_authorize('zoneform_default'); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } } // For edit zone rules if ($layout === 'setrule') { $this->rule_id = $jinput->get('zonerule_id'); // Getting zone rule detail $this->ruleDetail = $model->getZoneRuleDetail($this->rule_id); if (!empty($this->ruleDetail->country_id)) { // Getting Regions from country $this->getRegionList = $model->getRegionList($this->ruleDetail->country_id); } // Getting countries $country = $model->getCountry(); $this->country = $country; $app->setUserState('com_quick2cart.edit.zone.id', $previousId); } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
function getVersion() { if (!class_exists('comquick2cartHelper')) { $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php'; JLoader::register('comquick2cartHelper', $path); JLoader::load('comquick2cartHelper'); } $helperobj = new comquick2cartHelper(); echo $latestversion = $helperobj->getVersion(); jexit(); }
/** * Display the view */ public function display($tpl = null) { $app = JFactory::getApplication(); $jinput = $app->input; $layout = $jinput->get('layout', 'edit'); $model = $this->getModel('taxprofile'); if ($layout == 'edit') { $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); // Get taxprofile_id $taxprofile_id = $app->input->get('id', 0); // Getting saved tax rules. if (!empty($taxprofile_id)) { $this->taxrules = $model->getTaxRules($taxprofile_id); } // Get store name while edit view if (!empty($this->item->id) && !empty($this->item->store_id)) { $comquick2cartHelper = new comquick2cartHelper(); $this->storeDetails = $comquick2cartHelper->getSoreInfo($this->item->store_id); // Getting tax rates and Adress types $this->taxrate = $model->getTaxRateListSelect($this->item->store_id, ''); $this->address = $model->getAddressList(); } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->addToolbar(); } else { $this->taxRule_id = $jinput->get('id'); $defaultTaxRateId = ''; $defaultAddressId = ''; // Getting saved tax rules. if (!empty($this->taxRule_id)) { $this->taxrules = $model->getTaxRules('', $this->taxRule_id); if (!empty($this->taxrules)) { $defaultTaxRateId = $this->taxrules[0]->taxrate_id; $defaultAddressId = $this->taxrules[0]->address; } // Get store id of taxrule $taxHelper = new taxHelper(); $store_id = $taxHelper->getStoreIdFromTaxrule($this->taxRule_id); if (empty($store_id)) { $this->qtcStoreNotFoundMsg(); } // Getting tax rates and Adress types $this->taxrate = $model->getTaxRateListSelect($store_id, $defaultTaxRateId); $this->address = $model->getAddressList($defaultAddressId); } } parent::display($tpl); }
function display($tpl = null) { global $mainframe, $option; $comquick2cartHelper = new comquick2cartHelper(); $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = $jinput->get('option'); //default layout is default $layout = $jinput->get('layout', 'default'); $this->setLayout($layout); // SEARCH TEXT BOX VALUE $search = $mainframe->getUserStateFromRequest($option . 'filter_search', 'filter_search', '', 'string'); $search = JString::strtolower($search); if ($search == null) { $search = ''; } $filter_order_Dir = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $filter_type = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order', 'filter_order', 'saleqty', 'string'); //GET STORE DETAIL FOR FILTER $this->store_details = $comquick2cartHelper->getAllStoreDetails(); //STORE FILTER search_store $search_store = $mainframe->getUserStateFromRequest($option . 'search_store', 'search_store', 0, 'INTEGER'); $model = $this->getModel('salesreport'); $this->items = $model->getSalesReport(); //var_dump($this->items);die; //GET STORE DETAIL FOR FILTER $this->store_details = $comquick2cartHelper->getAllStoreDetails(); $total = $this->get('Total'); // use for pagination $this->total = $total; $pagination = $this->get('Pagination'); $this->pagination = $pagination; // from date FILTER $fromDate = $mainframe->getUserStateFromRequest($option . 'salesfromDate', 'salesfromDate', '', 'RAW'); // to date FILTER $toDate = $mainframe->getUserStateFromRequest($option . 'salestoDate', 'salestoDate', '', 'RAW'); $lists['salesfromDate'] = $fromDate; $lists['salestoDate'] = $toDate; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_type; $lists['search_store'] = $search_store; $lists['search'] = $search; $this->lists = $lists; $payee_name = $mainframe->getUserStateFromRequest('com_quick2cart', 'payee_name', '', 'string'); // $lists['payee_name']=$payee_name; $this->addToolbar(); // FOR DISPLAY SIDE FILTER if (JVERSION >= 3.0) { $this->sidebar = JHtmlSidebar::render(); } //var_dump($this->items);die; parent::display($tpl); }
/** * Method to get a list of options for a list input. * * @return array An array of JHtml options. * * @since 11.4 */ protected function getOptions() { require_once JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php'; $comquick2cartHelper = new comquick2cartHelper(); // Get all stores. $stores = $comquick2cartHelper->getAllStoreDetails(); $options = array(); //$options[] = JHtml::_('select.option', '', JText::_('QTC_SELET_STORE')); foreach ($stores as $key => $value) { $options[] = JHtml::_('select.option', $key, $value['title']); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }
function onDisplayFieldValue(&$field, $item, $values = null, $prop = 'display') { // execute the code only if the field type match the plugin type if ($field->field_type != 'quick2cart') { return; } jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) { $mainframe = JFactory::getApplication(); $lang = JFactory::getLanguage(); $lang->load('com_quick2cart'); $comquick2cartHelper = new comquick2cartHelper(); $output = $comquick2cartHelper->getBuynow($item->id, "com_flexicontent"); } $field->{$prop} = $output; }
function display($tpl = null) { global $mainframe, $option; $this->params = JComponentHelper::getParams('com_quick2cart'); $user = JFactory::getUser(); $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = $jinput->get('option'); $view = $jinput->get('view'); $orderid = $jinput->get('orderid', ''); $emailMd5 = $jinput->get('guest_email', '', 'RAW'); $model = $this->getModel('downloads'); $layout = $jinput->get('layout', 'default'); $comquick2cartHelper = new comquick2cartHelper(); if ($layout == "default") { if ($emailMd5) { $this->guest_email_chk = $guest_email_chk = $comquick2cartHelper->checkmailhash($orderid, $emailMd5); //if order email and guest_email is same if (!$guest_email_chk) { $this->showMsg(JText::_('QTC_GUEST_MAIL_UNMATCH')); return false; } } if ($emailMd5) { $this->allDownloads = $model->getAllDownloads($user->id, $orderid); $this->pagination = $model->getPagination($user->id, $orderid); } else { $this->allDownloads = $model->getAllDownloads($user->id); $this->pagination = $model->getPagination($user->id); } $filter_order_Dir = $mainframe->getUserStateFromRequest($option . "{$view}.filter_order_Dir", 'filter_order_Dir', 'desc', 'word'); $filter_type = $mainframe->getUserStateFromRequest($option . "{$view}.filter_order", 'filter_order', 'oi.order_id', 'string'); $search = $mainframe->getUserStateFromRequest($option . 'search_list', 'search_list', '', 'string'); if ($search == null) { $search = ''; } // search filter $lists['search_list'] = $search; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_type; // Get data from the model $this->lists = $lists; } $this->_setToolBar(); parent::display($tpl); }
function fetchElement($name, $value, $node, $control_name) { $input = JFactory::getApplication()->input; $option = $input->get('option', ''); if ($option != 'com_k2') { return; } jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) { return true; } $lang = JFactory::getLanguage(); $lang->load('com_quick2cart', JPATH_ADMINISTRATOR); JHtml::_('behavior.modal', 'a.modal'); $html = ''; $client = "com_k2"; $pid = JRequest::getInt('cid'); // if($pid) { /* prefill k2 title */ $db = JFactory::getDBO(); $q = "SELECT `title` FROM `#__k2_items` WHERE `id` =" . (int) $pid; $db->setQuery($q); $k2item = $db->loadResult(); $jinput = JFactory::getApplication()->input; $jinput->set('qtc_article_name', $k2item); /* prefill k2 title */ if (!class_exists('comquick2cartHelper')) { // Require_once $path; $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php'; JLoader::register('comquick2cartHelper', $path); JLoader::load('comquick2cartHelper'); } $comquick2cartHelper = new comquick2cartHelper(); $path = $comquick2cartHelper->getViewpath('attributes', '', "ADMIN", "SITE"); ob_start(); include $path; $html = ob_get_contents(); ob_end_clean(); return $html; }
function getShipView() { $app = JFactory::getApplication(); $qtcshiphelper = new qtcshiphelper(); $comquick2cartHelper = new comquick2cartHelper(); $plgActionRes = array(); $jinput = $app->input; $extension_id = $jinput->get('extension_id'); $plugview = $jinput->get('plugview'); // Plugin view is not found in URL then check in post array. if (empty($plugview)) { $plugview = $jinput->post->get('plugview'); } // If extension related view if (!empty($extension_id)) { $plugName = $qtcshiphelper->getPluginDetail($extension_id); // Call specific plugin trigger JPluginHelper::importPlugin('tjshipping', $plugName); $dispatcher = JDispatcher::getInstance(); $plgRes = $dispatcher->trigger('TjShip_plugActionkHandler', array($jinput)); if (!empty($plgRes)) { $plgActionRes = $plgRes[0]; } } // Enque msg if (!empty($plgActionRes['statusMsg'])) { $app->enqueueMessage($plgActionRes['statusMsg']); } // Extra plugin Url params. if (!empty($plgActionRes['urlPramStr'])) { $plgUrlParam = '&' . $plgActionRes['urlPramStr']; } else { $plgUrlParam = '&plugview='; } //print" kasdflkjsdk $plgUrlParam"; die; $itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp'); $link = 'index.php?option=com_quick2cart&view=shipping&layout=list' . $plgUrlParam . '&extension_id=' . $extension_id . '&Itemid=' . $itemid; $this->setRedirect(JRoute::_($link, false)); }
function onK2AfterDisplayContent(&$item, &$params, $limitstart) { // Add Language file. $lang = JFactory::getLanguage(); $lang->load('com_quick2cart', JPATH_SITE); jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) { return true; } $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php'; if (!class_exists('comquick2cartHelper')) { // require_once $path; JLoader::register('comquick2cartHelper', $path); JLoader::load('comquick2cartHelper'); } $mainframe = JFactory::getApplication(); $lang = JFactory::getLanguage(); $lang->load('com_quick2cart'); $comquick2cartHelper = new comquick2cartHelper(); $output = $comquick2cartHelper->getBuynow($item->id, 'com_k2'); return $output; }
function _getquick2cartstoreHTML() { jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) { $lang = JFactory::getLanguage(); $lang->load('com_quick2cart', JPATH_SITE); $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php'; if (!class_exists('comquick2cartHelper')) { //require_once $path; JLoader::register('comquick2cartHelper', $path); JLoader::load('comquick2cartHelper'); } // Load assets comquick2cartHelper::loadQuicartAssetFiles(); $product_path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php'; if (!class_exists('productHelper')) { //require_once $path; JLoader::register('productHelper', $product_path); JLoader::load('productHelper'); } $params = $this->params; $no_of_stores = $params->get('no_of_stores', '2'); //Get profile id $user = CFactory::getRequestUser(); $model = new productHelper(); $target_data = $model->getUserStores($user->_userid, $no_of_stores); if (!empty($target_data)) { $html = "\n\t\t\t\t<div class='techjoomla-bootstrap' >\n\t\t\t\t\t<div class='row-fluid'>\n\t\t\t\t\t<ul class='thumbnails' >\n\t\t\t\t\t"; foreach ($target_data as $data) { $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'views' . DS . 'vendor' . DS . 'tmpl' . DS . 'thumbnail.php'; //@TODO condition vise mod o/p ob_start(); include $path; $html .= ob_get_contents(); ob_end_clean(); } $html .= "\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>"; return $html; } } }
?> <div class="controls"> <?php echo $this->lists['published']; ?> </div> <?php } else { echo $this->lists['published']; } ?> </div> <!-- SELECT STORE --> <?php //made by sanjivani $comquick2cartHelper = new comquick2cartHelper(); $this->store_role_list = $store_role_list = $comquick2cartHelper->getAllStoreIds(); //JLoader::import('managecoupon', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models'); if ($this->coupons) { $model = new quick2cartModelManagecoupon(); $this->coupons = $model->Editlist($this->coupons[0]->id); } $params = JComponentHelper::getParams('com_quick2cart'); $multivendor_enable = $params->get('multivendor'); //sanjivani end // $options[] = JHtml::_('select.option', "", "Select Country"); if ($multivendor_enable == '1') { ?> <div class="control-group"> <label for="qtc_store" class="control-label"><?php echo JHtml::tooltip(JText::_('QTC_PROD_SELECT_STORE_DES'), JText::_('QTC_PROD_SELECT_STORE'), '', JText::_('QTC_PROD_SELECT_STORE'));
function csvexport() { $model = $this->getModel("vendor"); $CSVData = $model->getCsvexportData(); $filename = "SalesPerSellerReport_" . date("Y-m-d"); $csvData = null; //$csvData.= "Item_id;Product Name;Store Name;Store Id;Sales Count;Amount;Created By;"; $headColumn = array(); $headColumn[0] = JText::_('COM_QUICK2CART_SALESPERSELLER_STORENAME'); $headColumn[1] = JText::_('COM_QUICK2CART_SALESPERSELLER_VENDORNAME'); // 'Product Name'; $headColumn[2] = JText::_('COM_QUICK2CART_SALESPERSELLER_STATUS'); $headColumn[3] = JText::_('COM_QUICK2CART_SALESPERSELLER_EMAIL'); $headColumn[4] = JText::_('COM_QUICK2CART_SALESPERSELLER_PHONE'); $headColumn[5] = JText::_('COM_QUICK2CART_SALESPERSELLER_SALE'); $csvData .= implode(";", $headColumn); $csvData .= "\n"; header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header("Content-disposition: filename=" . $filename . ".csv"); if (!empty($CSVData)) { $storeHelper = new storeHelper(); foreach ($CSVData as $data) { $csvrow = array(); $csvrow[0] = '"' . $data['title'] . '"'; $csvrow[1] = '"' . $data['username'] . '"'; if ($data['published'] == 1) { $status = JText::_('COM_QUICK2CART_PUBLISH'); } else { $status = JText::_('COM_QUICK2CART_UNPUBLISH'); } $csvrow[2] = '"' . $status . '"'; $csvrow[3] = '"' . $data['store_email'] . '"'; $csvrow[4] = '"' . $data['phone'] . '"'; $storeHelper = new storeHelper(); $comquick2cartHelper = new comquick2cartHelper(); $total_sale = $storeHelper->getTotalSalePerStore($data['id']); if ($total_sale) { $sale = $comquick2cartHelper->getFromattedPrice($total_sale); } $csvrow[5] = '"' . $sale . '"'; $csvData .= implode(";", $csvrow); $csvData .= "\n"; } } ob_clean(); echo $csvData . "\n"; jexit(); $link = JUri::base() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=salespervendor', false), strlen(JUri::base(true)) + 1); $this->setRedirect($link); }
/** * This function unpublishes taxrate. * * @since 2.2 * @return null */ function unpublish() { $app = JFactory::getApplication(); $input = JFactory::getApplication()->input; $cid = $input->get('cid', '', 'array'); JArrayHelper::toInteger($cid); $model = $this->getModel('shipprofiles'); if ($model->setItemState($cid, 0)) { $msg = JText::sprintf(JText::_('COM_QUICK2CART_S_SHIPPROFILE_UNPUBLISH_SUCCESSFULLY'), count($cid)); } $comquick2cartHelper = new comquick2cartHelper(); $itemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=vendor&layout=cp'); $redirect = JRoute::_('index.php?option=com_quick2cart&view=shipprofiles&Itemid=' . $itemid, false); $this->setMessage($msg); $this->setRedirect($redirect); }
/** * Search Quick2cart (Products). * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = JFactory::getLanguage()->getTag(); require_once JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'; $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_products', 1); $limit = $this->params->def('search_limit', 50); $nullDate = $db->getNullDate(); $date = JFactory::getDate(); $now = $date->toSql(); $text = trim($text); if ($text == '') { return array(); } switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE ' . $text; $wheres2[] = 'a.description LIKE ' . $text; $wheres2[] = 'a.metakey LIKE ' . $text; $wheres2[] = 'a.metadesc LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE ' . $word; $wheres2[] = 'a.description LIKE ' . $word; $wheres2[] = 'a.metakey LIKE ' . $word; $wheres2[] = 'a.metadesc LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $order = 'a.cdate ASC'; break; /*case 'popular': $order = 'a.hits DESC'; break;*/ /*case 'popular': $order = 'a.hits DESC'; break;*/ case 'alpha': $order = 'a.name ASC'; break; case 'category': $order = 'c.title ASC, a.title ASC'; break; case 'newest': default: $order = 'a.cdate DESC'; break; } $rows = array(); $query = $db->getQuery(true); // Search products. if ($sContent && $limit > 0) { $query->clear(); $query->select('a.item_id, a.name AS title, a.metadesc, a.metakey, a.cdate AS created')->select('a.description AS text')->select('c.title AS section')->from('#__kart_items AS a')->join('INNER', '#__categories AS c ON c.id=a.category')->where('(' . $where . ') AND a.state=1 AND c.published = 1')->group('a.item_id, a.name, a.metadesc, a.metakey, a.cdate, a.description, c.title, c.id')->order($order); $db->setQuery($query, 0, $limit); $list = $db->loadObjectList(); $limit -= count($list); if (isset($list)) { $comquick2cartHelper = new comquick2cartHelper(); $itemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=productpage&layout=default'); foreach ($list as $key => $item) { $link = 'index.php?option=com_quick2cart&view=productpage&layout=default&item_id=' . $item->item_id . '&Itemid=' . $itemid; $list[$key]->href = JRoute::_($link, false); } } $rows[] = $list; } $results = array(); if (count($rows)) { foreach ($rows as $row) { $new_row = array(); foreach ($row as $article) { $article->browsernav = ''; if (SearchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey'))) { $new_row[] = $article; } } $results = array_merge($results, (array) $new_row); } } return $results; }
function SendMailToAdminApproval($prod_values, $item_id, $newProduct = 1) { $loguser = JFactory::getUser(); $comquick2cartHelper = new comquick2cartHelper(); $app = JFactory::getApplication(); $mailfrom = $app->getCfg('mailfrom'); $fromname = $app->getCfg('fromname'); $sitename = $app->getCfg('sitename'); $params = JComponentHelper::getParams('com_quick2cart'); $sendto = $params->get('sale_mail'); $currency = $comquick2cartHelper->getCurrencySession(); //$params->get('addcurrency'); // @sheha : currency should take from session instead of param //$sendto = $mailfrom; $multiple_img = array(); $count = 0; $prod_imgs = $prod_values->get('qtc_prodImg', array(), "ARRAY"); $quick2cartModelProduct = new quick2cartModelProduct(); $multiple_img = $quick2cartModelProduct->getProdutImages($item_id); $body = ''; // Edit product if ($newProduct == 0) { $subject = JText::_('COM_Q2C_EDIT_PRODUCT_SUBJECT'); $subject = str_replace('{sellername}', $loguser->name, $subject); $body = JText::_('COM_Q2C_EDIT_PRODUCT_BODY'); $body = str_replace('{productname}', $prod_values->get('item_name', '', 'RAW'), $body); $pod_price = $prod_values->get('multi_cur', array(), "ARRAY"); $body = str_replace('{price}', $pod_price[$currency], $body); $body = str_replace('{sellername}', $loguser->name, $body); $body = str_replace('{sku}', $prod_values->get('sku', '', 'RAW'), $body); //~ for($i=0; $i < count($multiple_img); $i++) //~ { //~ print"<pre>"; print_r($multiple_img); die("222882"); //~ $body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>'; //~ } if (!empty($multiple_img)) { $multiple_img = (array) $multiple_img; foreach ($multiple_img as $key => $img) { $body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $img[$key] . '" alt="No image" ><br>'; } } } else { $subject = JText::_('COM_Q2C_PRODUCT_AAPROVAL_SUBJECT'); $body = JText::_('COM_Q2C_PRODUCT_AAPROVAL_BODY'); $body = str_replace('{title}', $prod_values->get('item_name', '', 'RAW'), $body); $body = str_replace('{sellername}', $loguser->name, $body); $desc = $prod_values->get('description', '', 'ARRAY'); $desc = strip_tags(trim($desc['data'])); $body = str_replace('{des}', $desc, $body); $body = str_replace('{link}', JUri::base() . 'administrator/index.php?option=com_quick2cart&view=products&filter_published=0', $body); for ($i = 0; $i < count($multiple_img); $i++) { $body .= '<br><img src="' . JUri::ROOT() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>'; } } $res = $comquick2cartHelper->sendmail($mailfrom, $subject, $body, $sendto); }
</div> </div> </div> <?php return false; } //load style sheet $document = JFactory::getDocument(); // for featured and top seller product $product_path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php'; if (!class_exists('productHelper')) { JLoader::register('productHelper', $product_path); JLoader::load('productHelper'); } $productHelper = new productHelper(); $comquick2cartHelper = new comquick2cartHelper(); $store_id = $this->store_id; ?> <div class="<?php echo Q2C_WRAPPER_CLASS; ?> "> <form name="adminForm" id="adminForm" class="form-validate" method="post"> <div class="row-fluid"> <div class="span9"> <!-- START ::for store info --> <?php if (!empty($this->storeDetailInfo)) { $sinfo = $this->storeDetailInfo; }