/** * Saves service attributes. * * @return null */ public function save() { $soxId = $this->getEditObjectId(); $aParams = oxConfig::getParameter("editval"); $oShop = oxNew("oxshop"); $oShop->load($soxId); //$aParams = $oShop->ConvertNameArray2Idx( $aParams); $oShop->assign($aParams); $oShop->save(); parent::Save(); }
/** * Saves changed shop configuration parameters. */ public function save() { parent::save(); // saving config params $this->saveConfVars(); $oShop = oxNew('oxshop'); if ($oShop->loadInLang($this->_iEditLang, $this->getEditObjectId())) { //assigning values $oShop->setLanguage(0); $oShop->assign(oxRegistry::getConfig()->getRequestParameter('editval')); $oShop->setLanguage($this->_iEditLang); $oShop->save(); // saving static url changes if (is_array($aStaticUrl = oxRegistry::getConfig()->getRequestParameter('aStaticUrl'))) { $this->_sActSeoObject = oxRegistry::get("oxSeoEncoder")->encodeStaticUrls($this->_processUrls($aStaticUrl), $oShop->getId(), $this->_iEditLang); } } }
/** * Executes parent method parent::render() and returns name of template * file "shop_system.tpl". * * @return string */ public function render() { parent::render(); $this->_aViewData['subjlang'] = $this->_iEditLang; // loading shop $oShop = oxNew('oxShop'); $oShop->loadInLang($this->_iEditLang, $this->_aViewData['edit']->getId()); $this->_aViewData['edit'] = $oShop; // loading static seo urls $sQ = "select oxstdurl, oxobjectid from oxseo where oxtype='static' and oxshopid=" . oxDb::getDb()->quote($oShop->getId()) . " group by oxobjectid order by oxstdurl"; $oList = oxNew('oxlist'); $oList->init('oxbase', 'oxseo'); $oList->selectString($sQ); $this->_aViewData['aStaticUrls'] = $oList; // loading active url info $this->_loadActiveUrl($oShop->getId()); return "shop_seo.tpl"; }
/** * Executes parent method parent::render(), passes shop configuration parameters * to Smarty and returns name of template file "shop_system.tpl". * * @return string */ public function render() { $myConfig = $this->getConfig(); parent::render(); $aConfArrs = array(); $oLang = oxRegistry::getLang(); $aLanguages = $oLang->getLanguageArray(); $sLangAbbr = $aLanguages[$oLang->getObjectTplLanguage()]->abbr; // loading shop location countries list (defines in which country shop exists) include "shop_countries.php"; $soxId = $this->getEditObjectId(); if (!$soxId) { $soxId = $myConfig->getShopId(); } $oDb = oxDb::getDb(); $sShopCountry = $oDb->getOne("select DECODE( oxvarvalue, " . $oDb->quote($myConfig->getConfigParam('sConfigKey')) . ") as oxvarvalue from oxconfig where oxshopid = '{$soxId}' and oxvarname = 'sShopCountry'", false, false); $this->_aViewData["shop_countries"] = $aLocationCountries[$sLangAbbr]; $this->_aViewData["confstrs"]["sShopCountry"] = $sShopCountry; return $this->_sThisTemplate; }
/** * Executes parent method parent::render(), creates oxshop object, passes it's * data to Smarty engine and returns name of template file "shop_license.tpl". * * @return string */ public function render() { $myConfig = $this->getConfig(); if ($myConfig->isDemoShop()) { throw oxNew("oxSystemComponentException", "license"); } parent::render(); $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId(); if ($soxId != "-1" && isset($soxId)) { // load object $oShop = oxNew("oxshop"); $oShop->load($soxId); $this->_aViewData["edit"] = $oShop; } $this->_aViewData["version"] = $myConfig->getVersion(); if (!$this->_canUpdate()) { $this->_aViewData['readonly'] = true; } return $this->_sThisTemplate; }
/** * Creates shop object, passes shop data to Smarty engine and returns name of * template file "dyn_trusted.tpl". * * @return string */ public function render() { parent::render(); $this->_aViewData['oxid'] = $this->getConfig()->getShopId(); $aConfStr = array(); $aConfBool = array(); $aIds = $this->_aViewData["confaarrs"]['iShopID_TrustedShops']; // compability to old data if ($aConfStrs = $this->_aViewData["str"]['iShopID_TrustedShops']) { $aIds = array(0 => $aConfStrs); } $this->_aViewData["aShopID_TrustedShops"] = $aIds; $this->_aViewData['aTsUser'] = $this->_aViewData["confaarrs"]['aTsUser']; $this->_aViewData['aTsPassword'] = $this->_aViewData["confaarrs"]['aTsPassword']; $this->_aViewData['tsTestMode'] = $this->_aViewData["confbools"]['tsTestMode']; $this->_aViewData['tsSealActive'] = $this->_aViewData["confbools"]['tsSealActive']; $this->_aViewData["alllang"] = oxLang::getInstance()->getLanguageNames(); $this->_aViewData["shoppaymenttypes"] = $this->getPaymentTypes(); $this->_aViewData["tspaymenttypes"] = $this->_aTSPaymentIds; return "dyn_trusted.tpl"; }
/** * Executes parent method parent::render(), passes shop configuration parameters * to Smarty and returns name of template file "shop_system.tpl". * * @return string */ public function render() { $myConfig = $this->getConfig(); parent::render(); $aConfArrs = array(); $oLang = oxRegistry::getLang(); $aLanguages = $oLang->getLanguageArray(); $sLangAbbr = $aLanguages[$oLang->getObjectTplLanguage()]->abbr; // loading shop location countries list (defines in which country shop exists) include "ShopCountries.php"; $soxId = $this->getEditObjectId(); if (!$soxId) { $soxId = $myConfig->getShopId(); } // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $masterDb = oxDb::getMaster(); $sShopCountry = $masterDb->getOne("select DECODE( oxvarvalue, " . $masterDb->quote($myConfig->getConfigParam('sConfigKey')) . ") as oxvarvalue from oxconfig where oxshopid = '{$soxId}' and oxvarname = 'sShopCountry'"); $this->_aViewData["shop_countries"] = $aLocationCountries[$sLangAbbr]; $this->_aViewData["confstrs"]["sShopCountry"] = $sShopCountry; return $this->_sThisTemplate; }
/** * Saves payment parameters changes. * * @return mixed */ public function save() { $oDb = oxDb::getDb(); $aParams = oxConfig::getParameter("confbools"); // Deleting old blocks for Tradoria Checkout ver.1.0.2 and updating payment type for old Tradoria Checkout orders $oDb->execute("DELETE `oxtplblocks` WHERE `OXID` IN ('tradoria_btn_top', 'tradoria_btn_bottom', 'tradoria_btn_minicart');"); $oDb->execute("UPDATE `oxorder` SET `OXPAYMENTTYPE` = 'rakuten' WHERE `OXPAYMENTTYPE`='tradoria';"); if ($aParams['blRakutenActive'] == 'true') { $oDb->execute("INSERT INTO `oxtplblocks` (`OXID`, `OXACTIVE`, `OXSHOPID`, `OXTEMPLATE`, `OXBLOCKNAME`, `OXPOS`, `OXFILE`, `OXMODULE`) VALUES ('rakuten_btn_top', '1', 'oxbaseshop', 'page/checkout/basket.tpl', 'basket_btn_next_top', '0', 'button', 'rakuten') ON DUPLICATE KEY UPDATE `OXACTIVE` = 1;"); $oDb->execute("INSERT INTO `oxtplblocks` (`OXID`, `OXACTIVE`, `OXSHOPID`, `OXTEMPLATE`, `OXBLOCKNAME`, `OXPOS`, `OXFILE`, `OXMODULE`) VALUES ('rakuten_btn_bottom', '1', 'oxbaseshop', 'page/checkout/basket.tpl', 'basket_btn_next_bottom', '0', 'button', 'rakuten') ON DUPLICATE KEY UPDATE `OXACTIVE` = 1;"); $oDb->execute("INSERT INTO `oxtplblocks` (`OXID`, `OXACTIVE`, `OXSHOPID`, `OXTEMPLATE`, `OXBLOCKNAME`, `OXPOS`, `OXFILE`, `OXMODULE`) VALUES ('rakuten_btn_minicart', '1', 'oxbaseshop', 'widget/minibasket/minibasket.tpl', 'widget_minibasket_total', '0', 'button', 'rakuten') ON DUPLICATE KEY UPDATE `OXACTIVE` = 1;"); } else { $oDb->execute("UPDATE `oxtplblocks` SET `OXACTIVE` = 0 WHERE `OXID` IN ('rakuten_btn_top', 'rakuten_btn_bottom', 'rakuten_btn_minicart');"); } parent::save(); // Refresh Smarty cache to hide/show Rakuten Checkout button on the front-end // oxUtils::getInstance()->rebuildCache(); // TODO: Discover "right" way to refresh Smarty cache. Line above doesn't work! (Oxid bug?) $smarty = oxUtilsView::getInstance()->getSmarty(); $smarty->clear_all_cache(); }
/** * Executes parent method parent::render(), creates oxshop object, passes it's * data to Smarty engine and returns name of template file "shop_license.tpl". * * @return string */ public function render() { $myConfig = $this->getConfig(); if ($myConfig->isDemoShop()) { /** @var oxSystemComponentException $oSystemComponentException */ $oSystemComponentException = oxNew("oxSystemComponentException", "license"); throw $oSystemComponentException; } parent::render(); $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId(); if ($soxId != "-1") { // load object $oShop = oxNew("oxshop"); $oShop->load($soxId); $this->_aViewData["edit"] = $oShop; } $this->_aViewData["version"] = $myConfig->getVersion(); $this->_aViewData['aCurVersionInfo'] = $this->_fetchCurVersionInfo($this->versionCheckLink); if (!$this->_canUpdate()) { $this->_aViewData['readonly'] = true; } return $this->_sThisTemplate; }
/** * Creates shop object, passes shop data to Smarty engine and returns name of * template file "dyn_trusted.tpl". * * @return string */ public function render() { parent::render(); $this->_aViewData['oxid'] = $this->getConfig()->getShopId(); return "dyn_econda.tpl"; }
/** * Add additional config type for modules. */ public function __construct() { parent::__construct(); $this->_aConfParams['password'] = '******'; }
/** * Executes parent method parent::render(), passes configuration data to * Smarty engine. * * @return string */ public function render() { $sReturn = parent::render(); $this->_aViewData['oxid'] = $this->getConfig()->getShopId(); return $sReturn; }
/** * Converts Multiline text to associative array. Returns this array. * * @param string $sMultiline Multiline text * * @return array */ protected function _multilineToAarray($sMultiline) { $aArr = $sMultiline; if (!is_array($aArr)) { $aArr = parent::_multilineToAarray($aArr); } return $aArr; }
/** * Creates shop object, passes shop data to Smarty engine and returns name of * template file "dyn_ipayment.tpl". * * @return string */ public function render() { parent::render(); $this->_aViewData['oxid'] = $this->getConfig()->getShopId(); return 'dyn_ipayment.tpl'; }