public function __construct() { parent::__construct(); require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $enabled = OPCconfig::getValue('xmlexport_config', 'xml_general_enable', 0, false); if (empty($enabled)) { die('XML Export not enabled'); } $this->enabled = $enabled; }
/** * Display the view */ public function display($tpl = null) { $model = $this->getModel(); //$config = JController::getModel('config', 'JModel'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_onepage' . DS . 'models' . DS . 'config.php'; $config = new JModelConfig(); $config->loadVmConfig(); $model->getGeneral($this); //var_dump($config); die(); $this->avai = $model->getAvai(); $this->model =& $model; $this->numprods = $model->getNumProducts(); $this->trackingfiles = $model->getPhpExportThemes(); $this->forms = $model->getJforms($this->trackingfiles); $this->shoppergroups = $model->getShopperGroups(); $this->langs = $model->getLanguages(); $this->isEnabled = $model->isEnabled(); $model->checkCompression($this); $this->xml_export_customs = OPCconfig::getValue('xmlexport_config', 'xml_export_customs', 0, false); //debug_zval_dump ($this->forms['adwordstracking']); die(); parent::display($tpl); }
function getOPCRegistration() { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $ret = new stdClass(); $ret->opc_registration_company = ''; $ret->opc_registration_name = ''; $ret->opc_registration_username = ''; $ret->opc_registration_email = ''; $ret->opc_registration_hash = '0_0'; $reg = OPCconfig::getValue('opc_registration', '', 0, $ret, false); if (is_array($reg)) { foreach ($reg as $k => $v) { $ret->{$k} = $v; } } if (!is_object($reg)) { return $ret; } if (empty($reg)) { return $ret; } return $reg; }
public static function setItemid() { $view = JRequest::getWord('view'); if ('cart' == $view || 'opc' == $view) { //include(JPATH_ROOT.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_onepage'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'onepage.cfg.php'); require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $newitemid = OPCconfig::getValue('opc_config', 'newitemid', 0, 0, true); if (!empty($newitemid)) { $GLOBALS['Itemid'] = $newitemid; $_REQUEST['Itemid'] = $newitemid; $_POST['Itemid'] = $newitemid; $_GET['Itemid'] = $newitemid; JRequest::setVar('Itemid', $newitemid); } } }
function display($tpl = null) { if (!class_exists('VmConfig')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; } VmConfig::loadConfig(true); if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php')) { include JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php'; } require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_onepage' . DS . 'models' . DS . 'config.php'; $model = new JModelConfig(); //$limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit')); //limitstart = JRequest::getVar('limitstart', 0); /* if (!file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_virtuemart'.DS.'classes'.DS.'ps_onepage.php')) { $model->install(true); } */ $model->loadVmConfig('config'); require_once JPATH_COMPONENT . DS . 'assets' . DS . 'export_helper.php'; $this->ehelper = new OnepageTemplateHelper(); $this->opcexts = $model->getOPCExtensions(); $countries = $model->getShippingCountries(); $pms = $model->getPaymentMethods(); $sty = $model->getClassNames(); $default_country = $model->getDefaultC(); $dis = $model->getDisabledOPC(); $this->assignRef('disable_onepage', $dis); $model->checkLangFiles(); $trackingfiles = $model->getPhpTrackingThemes(); $this->assignRef('trackingfiles', $trackingfiles); $model->getExtLangVars(); $langs = $model->getLanguages(); $css = $model->retCss(); $php = $model->retPhp(); $sids = $model->getShippingRates(); if (empty($sids)) { $sids = array(); } $coref = array(); $ulist = $model->getUserFieldsLists($coref); $this->assignRef('clist', $coref); $this->assignRef('ulist', $ulist); $langse = array(); $exts = array(); $lext = $model->listExts($exts, $langse); $adminxts = array(); $langse2 = array(); $lext2 = $model->listExtsaAdmin($adminxts, $langse2); $this->assignRef('exts', $exts); $this->assignRef('adminxts', $adminxts); $this->assignRef('extlangs', $langse); $langerr = $model->getlangerr(); $this->assignRef('langerr', $langerr); //$lang_vars = $model->getLangVars(); $templates = $model->getTemplates(); $errors = $model->getErrMsgs(); $statuses = $model->getOrderStatuses(); $codes = $model->getJLanguages(); $exthtml = $model->getExtensions(); $groups = $model->listShopperGroups(); $vatgroups = $model->listShopperGroupsSelect(); $lfields = $model->listUserfields(); //function getArticleSelector($name, $value, $required=false) require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $this->lang_thank_youpage = OPCconfig::getValue('ty_page', 'ty_page', 0, array(0 => '')); $this->model =& $model; $this->assignRef('groups', $groups); $this->assignRef('vatgroups', $vatgroups); $this->assignRef('lfields', $lfields); $this->assignRef('exthtml', $exthtml); $this->assignRef('codes', $codes); $this->assignRef('statuses', $statuses); $this->assignRef('errors', $errors); $this->assignRef('templates', $templates); //$this->assignRef('lang_vars', $lang_vars); if (empty($pms)) { $pms = array(); } $this->assignRef('pms', $pms); $this->assignRef('sty', $sty); $this->assignRef('countries', $countries); $this->assignRef('default_country', $default_country); $this->assignRef('langs', $langs); // ok $this->assignRef('css', $css); $this->assignRef('php', $php); $this->assignRef('sids', $sids); $model2 = $this->getModel(); $model2->checkTable(); // $currencies = $model->getAllCurrency($limitstart, $limit); // $total = $model->countRows(); jimport('joomla.html.pagination'); //$pageNav = new JPagination($total, $limitstart, $limit); //$this->assignRef('currencies', $currencies); //$this->assignRef('pageNav', $pageNav); parent::display($tpl); }
* One Page checkout is free software released under GNU/GPL and uses some code from VirtueMart * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * */ if (!defined('_VALID_MOS') && !defined('_JEXEC')) { die('Direct Access to ' . basename(__FILE__) . ' is not allowed.'); } $document = JFactory::getDocument(); ob_start(); echo '<div id="vmMainPageOPC">'; include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $newitemid = OPCconfig::getValue('opc_config', 'newitemid', 0, 0, true); if (OPCloader::checkOPCSecret()) { $selected_template .= '_preview'; } $currentUser = JFactory::getUser(); $uid = $currentUser->get('id'); if (!empty($uid)) { $no_login_in_template = true; } JHTMLOPC::stylesheet('onepage.css', 'components/com_onepage/themes/' . $selected_template . '/', array()); //JHTML::_('behavior.formvalidation'); JHTMLOPC::stylesheet('vmpanels.css', 'components/com_virtuemart/assets/css/', array()); if (!empty($load_min_bootstrap)) { JHTMLOPC::stylesheet('bootstrap.min.css', 'components/com_onepage/themes/extra/bootstrap/', array()); } if (VM_REGISTRATION_TYPE == 'NO_REGISTRATION') {
function getJforms($files) { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'jformrender.php'; /* if (!OPCJ3) { require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_onepage'.DS.'helpers'.DS.'opcparameters.php'); } */ $ret = array(); foreach ($files as $file) { $path = JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'trackers' . DS . 'php' . DS . $file . '.xml'; if (!file_exists($path)) { continue; } $default = new stdClass(); //$data->adwords_id = 1; $data = OPCconfig::getValue('tracking_config', $file, 0, $default); $title = $description = ''; if (function_exists('simplexml_load_file')) { $fullxml = simplexml_load_file($path); $title = $fullxml->name; $description = $fullxml->description; } $xml = file_get_contents($path); $xml = str_replace('extension', 'form', $xml); $xml = str_replace('params', 'fieldset', $xml); $xml = str_replace('<fieldset', '<fields name="' . $file . '"><fieldset name="test" label="' . $title . '" ', $xml); $xml = str_replace('param', 'field', $xml); $xml = str_replace('</fieldset>', '</fieldset></fields>', $xml); //$fullxml = simplexml_load_string($xml); // removes BOM: $bom = pack('H*', 'EFBBBF'); $text = preg_replace("/^{$bom}/", '', $xml); if (!empty($text)) { $xml = $text; } $t1 = simplexml_load_string($xml); if ($t1 === false) { continue; } $test = JForm::getInstance($file, $xml, array(), true); //$test->bind($data); foreach ($data as $k => $vl) { $test->setValue($k, $file, $vl); } $fieldSets = $test->getFieldsets(); $test = OPCparametersJForm::render($test); $ret[$file]['params'] = $test; if (empty($title)) { $ret[$file]['title'] = $file . '.php'; } else { $ret[$file]['title'] = (string) $title; } $ret[$file]['description'] = (string) $description; } return $ret; }
function getTos(&$ref) { include JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php'; $link = $this->getTosLink($ref); if (!empty($link)) { if (!empty($tos_scrollable)) { $start = '<iframe src="' . $link . '" class="tos_iframe" >'; $end = '</iframe>'; return $start . $end; } } $start = ''; $end = ''; if (empty($ref->cart->vendor->vendor_terms_of_service)) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; $vendorModel = OPCmini::getModel('vendor'); $vendor = $vendorModel->getVendor(); $ref->cart->vendor->vendor_terms_of_service = $vendor->vendor_terms_of_service; } $tos_config = OPCconfig::getValue('opc_config', 'tos_config', 0, 0, true); if (empty($tos_config)) { return $ref->cart->vendor->vendor_terms_of_service; } if (!is_numeric($tos_config)) { return $start . $ref->cart->vendor->vendor_terms_of_service . $end; } if (is_numeric($tos_config)) { $article = JTable::getInstance("content"); $article->load($tos_config); $intro = $article->get('introtext'); $full = $article->get("fulltext"); // and/or fulltext JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); $mainframe = JFactory::getApplication(); $params = $mainframe->getParams('com_content'); $title = '<div class="componentheading' . $params->get('pageclass_sfx') . '">' . $article->get('title') . '</div>'; if (empty($article->text)) { $article->text = $title . $intro . $full; } $results = $dispatcher->trigger('onPrepareContent', array(&$article, &$params, 0)); $results = $dispatcher->trigger('onContentPrepare', array('text', &$article, &$params, 0)); return $start . $article->get('text') . $end; } return ""; }
<select style="min-width: 150px; " data-placeholder="<?php echo JText::_('COM_VIRTUEMART_COUNTRY_S'); ?> " multiple="multiple" name="country_currency[<?php echo $c->virtuemart_currency_id; ?> ][]" class="vm-chzn-select" id="country_currency_<?php echo $c->virtuemart_currency_id; ?> "> <?php $default = 0; if (!empty($this->countries)) { foreach ($this->countries as $p) { $c_int = (int) OPCconfig::getValue('currency_config', $p['country_2_code'], 0, $default); $p['virtuemart_country_id'] = (int) $p['virtuemart_country_id']; ?> <option value=<?php echo '"' . $p['virtuemart_country_id'] . '"'; if ($c_int == $c->virtuemart_currency_id) { echo ' selected="selected" '; } ?> ><?php echo $p['country_name']; ?> </option> <?php }
public function __construct($orderID, $params2, $status, $params, $file = '') { $this->errorMsg = ''; if (empty(OPCtrackingHelper::$config[$status])) { $this->errorMsg .= 'Config not found for status: ' . $status . "<br />\n"; $this->error = true; return; } $this->params = new stdClass(); if (!empty($params)) { $this->params = $params; } //$this->pingUrl = JRoute::_('index.php?option=com_onepage&task=ping&nosef=1&format=raw&tmpl=component', false); $this->pingUrl = OPCtrackingHelper::getUrl() . 'index.php?option=com_onepage&task=ping&nosef=1&format=raw&tmpl=component'; if (method_exists('JApplication', 'getHash')) { $hashn = JApplication::getHash('opctracking'); } else { $hashn = JUtility::getHash('opctracking'); } $opchash = JRequest::getVar($hashn, false, 'COOKIE'); $this->cookieHash = $opchash; $this->pingData = 'hash=' . $this->escapeSingle(str_replace('&', '&', $opchash)); require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; $orderModel = OPCmini::getModel('orders'); $this->order = $orderModel->getOrder($orderID); if (empty($this->order)) { $this->errorMsg .= 'Order not found: ' . var_export($config, true) . "<br />\n"; $this->error = true; return; } if (empty($this->order['items']) || !is_array($this->order['items'])) { $this->errorMsg .= 'Order items not found: ' . var_export($config, true) . "<br />\n"; $this->error = true; return; } require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $negative_statuses = OPCconfig::getValue('tracking_negative', 'negative_statuses', 0, array()); if (!empty($negative_statuses)) { $copy_negative_statuses = array(); foreach ($negative_statuses as $key => $ng) { $copy_negative_statuses[$key] = $ng; } $negative_statuses = $copy_negative_statuses; if (is_array($negative_statuses)) { if (isset($this->order['details']['BT'])) { if (in_array($this->order['details']['BT']->order_status, $negative_statuses)) { OPCtrackingHelper::getNegativeOrder($this->order); } } } } if (empty($this->order['details'])) { $this->errorMsg .= 'Order details not found: ' . var_export($config, true) . "<br />\n"; $this->error = true; return; } // check if the tracking was enabled before or after the order was created if (is_array($this->order)) { if (!empty($this->order['details']['BT'])) { $c = $this->order['details']['BT']->created_on; $sql = $c; $date = new JDate($sql); $time = $date->toUnix(); if (!empty(OPCtrackingHelper::$config)) { if (!empty(OPCtrackingHelper::$config[$status])) { // opc update, old codee: $key = 'since' . $file; if (!empty(OPCtrackingHelper::$config[$status]->{$key})) { $since = OPCtrackingHelper::$config[$status]->{$key}; if ($since > $time) { $this->errorMsg .= 'OPC tracking was created AFTER the order was created: ' . var_export(OPCtrackingHelper::$config, true) . 'order created on ' . $c . date(DATE_RFC2822, $time) . ' tracking created on ' . $since . date(DATE_RFC2822, $since) . " <br />\n"; $this->error = true; return; } } $key = $file . '_since'; if (!empty(OPCtrackingHelper::$config[$status]->{$key})) { $since = OPCtrackingHelper::$config[$status]->{$key}; if ($since > $time) { $this->errorMsg .= 'OPC tracking system plugin was set up AFTER the order was created: ' . var_export(OPCtrackingHelper::$config, true) . 'order created on ' . $c . ' ' . date(DATE_RFC2822, $time) . ' tracking created on ' . $since . date(DATE_RFC2822, $since) . " <br />\n"; $this->error = true; return; } } } } } } $this->error = false; $this->pingData .= '&order_status=' . $status; $this->pingData .= '&order_id=' . $orderID; OPCtrackingHelper::getTextFields($this->order); $this->vendor = OPCtrackingHelper::getVendorInfo($this->order['details']['BT']->virtuemart_vendor_id); }
function getThemeConfig($file) { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $default = new stdClass(); $data = OPCconfig::getValue('xmlexport_config', $file, 0, $default); $generalconfig = new stdClass(); $this->getGeneral($generalconfig); if (!isset($data->xmlfile)) { $data->xmlfile = $file . '.xml'; } if (empty($data->xmlfile)) { $data->xmlpath = $generalconfig->xml_export_path . $file . '.xml'; } else { $data->xmlpath = $generalconfig->xml_export_path . $data->xmlfile; } $data->xmlurl = $this->getXMLUrl($generalconfig, $data); if (!isset($data->cname)) { $data->cname = $file; } return $data; }
public function store() { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $theme = OPCconfig::get('selected_template'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $theme = JFile::makeSafe($theme); $data = JRequest::get('post'); $config = OPCconfig::buildObject($data[$theme]); if (!is_object($config)) { $config = new stdClass(); } $prevConfig = OPCconfig::getValue('theme_config', $theme, 0, $config); OPCconfig::store('theme_config', $theme, 0, $config); $data = OPCconfig::getValue('theme_config', $file, 0, $default, false); return ''; }
public static function getTosLink(&$ref, &$OPCloader) { $cart = $ref->cart; include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $opclang = JFactory::getLanguage()->getTag(); $tos_config = OPCconfig::getValue('opc_config', 'tos_config', 0, 0, true); if (empty($tos_config) || !is_numeric($tos_config)) { $itemid = JRequest::getVar('Itemid', ''); if (!empty($itemid)) { $itemid = '&Itemid=' . $itemid; } else { $itemid = ''; } $tos_link = OPCloader::getUrl() . 'index.php?nosef=1&format=html&option=com_virtuemart&view=vendor&layout=tos&virtuemart_vendor_id=' . $cart->vendor->virtuemart_vendor_id . '&tmpl=component' . $itemid; require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'version.php'; $x = VmVersion::$RELEASE; if (strpos($x, '${PHING.VM.RELEASE}') === false) { if (!version_compare($x, '2.0.2', '>=')) { return ""; } } } else { //if (!empty($newitemid)) //$tos_link = JRoute::_('index.php?option=com_content&view=article&id='.$tos_config.'&tmpl=component&Itemid='.$newitemid); //else $tos_itemid = OPCconfig::getValue('opc_config', 'tos_itemid', 0, 0, true); if (!empty($tos_itemid)) { $tos_link = JRoute::_('index.php?option=com_content&view=article&id=' . $tos_config . '&tmpl=component&Itemid=' . $tos_itemid); } else { $tos_link = JRoute::_('index.php?option=com_content&view=article&id=' . $tos_config . '&tmpl=component'); } } $b1 = JURI::root(true); if (!empty($b1)) { if (strpos($tos_link, $b1) === 0) { $tos_link = substr($tos_link, strlen($b1)); } } if (strpos($tos_link, 'http') !== 0) { $base = JURI::root(); if (substr($base, -1) == '/') { $base = substr($base, 0, -1); } if (substr($tos_link, 0, 1) !== '/') { $tos_link = '/' . $tos_link; } $tos_link = $base . $tos_link; } if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { $tos_link = str_replace('http:', 'https:', $tos_link); } return $tos_link; }
function renderOption($entity, $vmCat, $refCat, $txt) { $data = array(); $data['entity'] = $entity; $data['vmcat'] = $vmCat; $data['refcat'] = $refCat; $data['reftxt'] = $txt; $json = urlencode(json_encode($data)); require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $default = new stdClass(); $res = OPCconfig::getValue('xmlexport_pairing', $entity, $vmCat, $default); $ret = '<option value="' . $refCat . '" '; if (!empty($res)) { if (isset($res->id)) { if ($res->id == $refCat) { $ret .= ' selected="selected" '; } } } $ret .= ' data="' . $json . '">' . $txt . '</option>'; return $ret; }
public static function addItem($product, $vm1m) { // internal error: if (empty($product->virtuemart_product_id)) { return; } foreach (OPCXmlExport::$classes as $class) { if (method_exists($class, 'addItem')) { // check the shopper group: if (empty($product->shoppergroups) || in_array($class->config->shopper_group, $product->shoppergroups)) { if (in_array($class->config->child_type, $product->child_type)) { $product2 = $product; OPCXmlExport::updateProduct($product2, $class, $vm1); //get pairing info: //if (!empty($product->categories)) if (!empty($vm1['cats'])) { //$product2->paired_category_name = reset($vm1['cats']); $deepestcat = $vm1['longest_cats'][count($vm1['longest_cats']) - 1]; $product2->paired_category_name = $deepestcat; if (!empty($vm1['longest_cat_id'])) { // take the first: $cat_id = $vm1['longest_cat_id']; //$product->categories[0]; $default = new stdClass(); $entity = $class->entity; $res = OPCconfig::getValue('xmlexport_pairing', $entity, $cat_id, $default); if (!empty($res) && !empty($res->txt)) { $product2->paired_category_name = $res->txt; } $product2->pairedObj = $res; } } else { $product2->paired_category_name = ''; } $ret = $class->addItem($product2, $vm1); $class->writer->write($ret); } } } } }
die('Direct Access to ' . basename(__FILE__) . ' is not allowed.'); } /* * * @copyright Copyright (C) 2007 - 2010 RuposTel - All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * One Page checkout is free software released under GNU/GPL and uses code from VirtueMart * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * */ require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $default = new stdClass(); $config = OPCconfig::getValue('theme_config', $selected_template, 0, $default, false); $has_guest_tab = true; if (!empty($config) && isset($config->one_step)) { $use_multi_step = $config->one_step; $has_guest_tab = $config->has_guest_tab; } else { $use_multi_step = true; } if (empty($registration_html)) { $no_login_in_template = true; } echo $intro_article; if (!empty($paypal_express_button)) { ?> <div id="op_paypal_express" style="float: right; clear: both; width: 100%; padding-top: 10px;"> <?php
public static function updateHtml($html, &$order, $afterrender = false) { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; $ty_page = OPCconfig::getValue('ty_page', 'ty_page', 0, array()); if (empty($ty_page)) { return; } if (empty($order)) { return; } if (is_array($order)) { if (isset($order['details'])) { $order = $order['details']['BT']; } } //we must reload order here in case any plugin had changed it in meantime: $id = $order->virtuemart_order_id; if (!empty($id)) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; $orderModel = OPCmini::getModel('orders'); $order_full = $orderModel->getOrder($id); if (empty($order_full)) { return; } $order = $order_full['details']['BT']; } $status = $order->order_status; if (!is_object($order)) { return; } $payment_id = $order->virtuemart_paymentmethod_id; if (empty($order->order_language)) { $jlang = JFactory::getLanguage(); $cl = $jlang->getTag(); $cl = strtolower(str_replace('-', '_', $cl)); } else { $cl = $order->order_language; } // check conditions: $orightml = $html; $todo = array(); foreach ($ty_page as $k => $ty) { if (!is_object($ty)) { continue; } if ($ty->payment_id != $payment_id) { continue; } if (!empty($ty->language)) { if ($ty->language != $cl) { continue; } } if ($ty->order_status != $status) { continue; } $todo[] = $ty; } if (empty($todo)) { return; } /* COM_ONEPAGE_TY_MODE_0="Prepend to payment generated html" COM_ONEPAGE_TY_MODE_1="Append to payment generated html" COM_ONEPAGE_TY_MODE_2="Replace payment generated html" */ require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'loader.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'opctracking.php'; $repvals = array(); $order_object = new stdClass(); OPCtrackingHelper::getOrderVars($id, $repvals, $order_object, false); foreach ($todo as $ty2) { $htmla = OPCloader::getArticle($ty2->article_id, $repvals); if (empty($ty2->mode)) { $html = $htmla . '<br />' . $html; } else { if ($ty2->mode == 1) { $html = $html . '<br />' . $htmla; } else { if ($ty->mode == 2) { $html = $htmla; } } } } if (defined('TYMODDONE')) { return $html; } else { define('TYMODDONE', true); } if ($orightml != $html) { if (!$afterrender) { JRequest::setVar('html', $html); } else { $buffer = JResponse::getBody(); $buffer = str_replace($orightml, $html, $buffer); JResponse::setBody($buffer); } } return $html; }
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED); $app->initialise(); //disable buffer: echo @ob_get_clean(); echo @ob_get_clean(); echo @ob_get_clean(); echo @ob_get_clean(); echo @ob_get_clean(); echo @ob_get_clean(); echo @ob_get_clean(); define('JPATH_COMPONENT', JPATH_SITE . DS . 'components' . DS . 'com_onepage'); require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'compatibility.php'; JRequest::setVar('view', 'xmlexport'); JRequest::setVar('option', 'com_onepage'); JRequest::setVar('format', 'opchtml'); JRequest::setVar('tmpl', 'component'); JRequest::setVar('template', 'system'); //ini_set('memory_limit','256Mb'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_onepage' . DS . 'models' . DS . 'xmlexport.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'controllers' . DS . 'xmlexport.php'; $livesite = OPCconfig::getValue('xmlexport_config', 'xml_live_site', 0, ''); $livesite = substr($livesite, strpos($livesite, '//') + 2, -1); $_SERVER['HTTP_HOST'] = $livesite; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'xmlexport.php'; $VirtueMartControllerXmlexport = new VirtueMartControllerXmlexport(); $VirtueMartControllerXmlexport->createXml(); echo "\n"; $app->close(); die(0);
<input id="adwords_amount_0" type="text" name="adwords_amount_0" value="<?php if (!empty($adwords_amount[0])) { echo $adwords_amount[0]; } ?> "/> </td><td><?php echo JText::_('COM_ONEPAGE_TRACKING_ADWORDS_AMOUNT_NAME'); ?> </td> </tr> <tr > <?php $negative_statuses = OPCconfig::getValue('tracking_negative', 'negative_statuses', 0, array()); if (empty($negative_statuses)) { $negative_statuses = array('X', 'R'); } ?> <td> <select name="negative_statuses[]" multiple="multiple" style="width: 150px;" class="vm-chzn-select" > <?php foreach ($this->statuses as $k => $s) { echo '<option '; if (!empty($negative_statuses)) { if (in_array($s['order_status_code'], $negative_statuses)) { echo ' selected="selected" '; } } echo ' value="' . $s['order_status_code'] . '">' . JText::_($s['order_status_name']) . '</option>';