Sets some global parameters to Smarty engine (such as self link, etc.), returns
modified shop object.

@param object $oShop Object to modify some parameters

@return object
6528
public function addGlobalParams($oShop = null)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();

        $oShop = parent::addGlobalParams($oShop);

        // override cause of admin dir
        $sURL = $myConfig->getConfigParam('sShopURL') . $myConfig->getConfigParam('sAdminDir') . "/";

        if ($myConfig->getConfigParam('sAdminSSLURL')) {
            $sURL = $myConfig->getConfigParam('sAdminSSLURL');
        }

        $oViewConf = $this->getViewConfig();
        $oViewConf->setViewConfigParam('selflink', \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($sURL . 'index.php?editlanguage=' . $this->_iEditLang, false));
        $oViewConf->setViewConfigParam('ajaxlink', str_replace('&amp;', '&', \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($sURL . 'oxajax.php?editlanguage=' . $this->_iEditLang, false)));

        // set language of admin backend
        $this->_aViewData['adminlang'] = $oLang->getTplLanguage();
        $this->_aViewData['charset'] = $this->getCharSet();

        //setting active currency object
        $this->_aViewData["oActCur"] = $myConfig->getActShopCurrencyObject();

        return $oShop;
    }
380916
protected function setApplyData()
    {
        if (!isset($this->job)) {
            throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job');
        }
        
        $data = [
            'applyId' => $this->job->getApplyId(),
            'uri' => null,
            'oneClickProfiles' => []
        ];
        $atsMode = $this->job->getAtsMode();
        
        if ($atsMode->isIntern() || $atsMode->isEmail()) {
            $data['uri'] = $this->urlPlugin->fromRoute('lang/apply', ['applyId' => $this->job->getApplyId()], ['force_canonical' => true]);
        } elseif ($atsMode->isUri()) {
            $data['uri'] = $atsMode->getUri();
        }
        
        if ($atsMode->isIntern() && $atsMode->getOneClickApply()) {
            $data['oneClickProfiles'] = $atsMode->getOneClickApplyProfiles();
        }
        
        $this->container['applyData'] = $data;
        
        return $this;
    }
1069825
public function setProduct(ChildProduct $v = null)
    {
        if ($v === null) {
            $this->setProductId(NULL);
        } else {
            $this->setProductId($v->getId());
        }

        $this->aProduct = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildProduct object, it will not be re-added.
        if ($v !== null) {
            $v->addDealerProduct($this);
        }


        return $this;
    }
511471
public function setEngine(string $engine)
  {
    if (in_array($engine, ['modulus', 'blade'])) {
      $this->engine = $engine;
      return $this;
    }

    $this->exception('Engine "' . $engine . '" does not exist.');
  }
540550
public function save()
    {
        // saving config params
        $this->saveConfVars();

        //saving additional fields ("oxshops__oxdefcat"") that goes directly to shop (not config)
        /** @var \OxidEsales\Eshop\Application\Model\Shop $oShop */
        $oShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class);
        if ($oShop->load($this->getEditObjectId())) {
            $oShop->assign(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"));
            $oShop->save();
        }
    }
525853
protected function prepareShop()
    {
        $testConfig = $this->getTestConfig();

        $shopPath = $testConfig->getShopPath();
        require_once $shopPath .'bootstrap.php';

        $tempDirectory = $testConfig->getTempDirectory();
        if ($tempDirectory && $tempDirectory != '/') {
            $fileCopier = new FileCopier();
            $fileCopier->createEmptyDirectory($tempDirectory);
        }
    }
649674
public function copyThis($oProduct)
    {
        $aObjectVars = get_object_vars($oProduct);

        foreach ($aObjectVars as $sName => $sValue) {
            if (isset($oProduct->$sName->value)) {
                $sFieldName = preg_replace('/oxarticles__/', 'oxorderarticles__', $sName);
                if ($sFieldName != "oxorderarticles__oxtimestamp") {
                    $this->$sFieldName = $oProduct->$sName;
                }
                // formatting view
                if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSkipFormatConversion')) {
                    if ($sFieldName == "oxorderarticles__oxinsert") {
                        \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($this->$sFieldName, true);
                    }
                }
            }
        }
    }
1126475
protected function _setRootObjectData()
    {
        $this->setId('root');
        $this->oxmanufacturers__oxicon = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->oxmanufacturers__oxtitle = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('BY_MANUFACTURER', $this->getLanguage(), false), \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->oxmanufacturers__oxshortdesc = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW);

        return true;
    }
579479
public function setWebhooks($shop)
    {
        $endpoint = $this->endpoint.'/webhooks';

        $params = array_merge($this->prepareParams(), ['shop' => $shop] );

        return $this->restClient->post( $endpoint, $params );
    }
130964
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        parent::render();

        $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
        if (isset($soxId) && $soxId != "-1") {
            // load object
            $this->_aViewData["edit"] = $oShop = $this->_getEditShop($soxId);

            try {
                // category choosen as default
                $this->_aViewData["defcat"] = null;
                if ($oShop->oxshops__oxdefcat->value) {
                    $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
                    if ($oCat->load($oShop->oxshops__oxdefcat->value)) {
                        $this->_aViewData["defcat"] = $oCat;
                    }
                }
            } catch (Exception $oExcp) {
                // on most cases this means that views are broken, so just
                // outputting notice and keeping functionality flow ..
                $this->_aViewData["updateViews"] = 1;
            }

            $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc");
            if ($iAoc == 1) {
                $oShopDefaultCategoryAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ShopDefaultCategoryAjax::class);
                $this->_aViewData['oxajax'] = $oShopDefaultCategoryAjax->getColumns();

                return "popups/shop_default_category.tpl";
            }
        }

        $aDbVariables = $this->loadConfVars($soxId, $this->_getModuleForConfigVars());
        $aConfVars = $aDbVariables['vars'];
        $aConfVars['str']['sVersion'] = $myConfig->getConfigParam('sVersion');

        $this->_aViewData["var_constraints"] = $aDbVariables['constraints'];
        $this->_aViewData["var_grouping"] = $aDbVariables['grouping'];
        foreach ($this->_aConfParams as $sType => $sParam) {
            $this->_aViewData[$sParam] = $aConfVars[$sType];
        }

        // #251A passing country list
        $oCountryList = oxNew(\OxidEsales\Eshop\Application\Model\CountryList::class);
        $oCountryList->loadActiveCountries(\OxidEsales\Eshop\Core\Registry::getLang()->getObjectTplLanguage());
        if (isset($aConfVars['arr']["aHomeCountry"]) && count($aConfVars['arr']["aHomeCountry"]) && count($oCountryList)) {
            foreach ($oCountryList as $sCountryId => $oCountry) {
                if (in_array($oCountry->oxcountry__oxid->value, $aConfVars['arr']["aHomeCountry"])) {
                    $oCountryList[$sCountryId]->selected = "1";
                }
            }
        }

        $this->_aViewData["countrylist"] = $oCountryList;

        // checking if cUrl is enabled
        $this->_aViewData["blCurlIsActive"] = (!function_exists('curl_init')) ? false : true;

        /** @var ContactFormBridgeInterface $contactFormBridge */
        $contactFormBridge = $this->getContainer()->get(ContactFormBridgeInterface::class);
        $contactFormConfiguration = $contactFormBridge->getContactFormConfiguration();

        /** @var FieldConfigurationInterface $fieldConfiguration */
        foreach ($contactFormConfiguration->getFieldConfigurations() as $fieldConfiguration) {
            $this->_aViewData['contactFormFieldConfigurations'][] = [
                'name' => $fieldConfiguration->getName(),
                'label' => $fieldConfiguration->getLabel(),
                'isRequired' => $fieldConfiguration->isRequired(),
            ];
        }

        return $this->_sThisTemplate;
    }
1372008
public function changeshipping()
    {
        $oSession = $this->getSession();

        $oBasket = $oSession->getBasket();
        $oBasket->setShipping(null);
        $oBasket->onUpdate();
        $oSession->setVariable('sShipSet', \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sShipSet'));
    }
491205
public function setMovitelPublicKey($movitelPublicKey = '')
    {
        $this->movitelPublicKey = $movitelPublicKey;
        $this->debug->info(__FUNCTION__, 'setMovitelPublicKey: ' . json_encode($this->movitelPublicKey));

        return $this;
    }
1146843
public function child()
    {
        $child = self::i()->setParent($this);
        
        foreach ($this->globalMiddleware as $callback) {
            $child->add($callback);
        }
        
        foreach ($this->routeMiddleware as $method => $route) {
            $child->route($method, $route[0], $route[1]);
        }
        
        foreach ($this->errorMiddleware as $callback) {
            $child->error($callback);
        }
        
        return $child;
    }
537279
public static function edit_module_parameters() {
        return new external_function_parameters(
            array(
                'action' => new external_value(PARAM_ALPHA,
                    'action: hide, show, stealth, duplicate, delete, moveleft, moveright, group...', VALUE_REQUIRED),
                'id' => new external_value(PARAM_INT, 'course module id', VALUE_REQUIRED),
                'sectionreturn' => new external_value(PARAM_INT, 'section to return to', VALUE_DEFAULT, null),
            ));
    }
573231
public function ModuleInitHook()
    {
        parent::ModuleInitHook();
        $oShop = TdbShop::GetInstance();
        if ($oShop->fieldRedirectToNotFoundPageProductSearchOnNoResults) {
            // in this case the shop may redirect after running the search. since this occurs in the Execute of the module, we need
            // to prevent any other output from being auto-sent to the browser
            TGlobal::GetController()->SetBlockAutoFlushToBrowser(true);
        }
    }
1331570
public function setAsDefault()
    {
        $defCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("defcat");
        $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $quotedOxId = $database->quote($oxId);
        $quotedDefCat = $database->quote($defCat);

        $queryToEmbed = $this->formQueryToEmbedForSettingCategoryAsDefault();

        // #0003650: increment all product references independent to active shop
        $query = "update oxobject2category set oxtime = oxtime + 10 where oxobjectid = {$quotedOxId} {$queryToEmbed}";
        \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query);

        // set main category for active shop
        $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$quotedOxId} " .
              "and oxcatnid = {$quotedDefCat} {$queryToEmbed}";
        \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query);
        //echo "\n$sQ\n";

        // #0003366: invalidate article SEO for all shops
        \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->markAsExpired($oxId, null, 1, null, "oxtype='oxarticle'");
        $this->resetContentCache();
    }
73596
public function SetActivePaymentMethod($oShopPayment)
    {
        $oldActivePaymentMethod = $this->GetActivePaymentMethod();
        $isPaymentSet = parent::SetActivePaymentMethod($oShopPayment);
        $newActivePaymentMethod = $this->GetActivePaymentMethod();
        if (null === $oldActivePaymentMethod || null === $newActivePaymentMethod) {
            return $isPaymentSet;
        }
        if (false === $oldActivePaymentMethod->IsSameAs($newActivePaymentMethod)) {
            return $isPaymentSet;
        }
        $activeCurrency = $this->getCurrencyService()->getObject();

        if (null === $newActivePaymentMethod->fieldValueOriginal && true == $activeCurrency->fieldIsBaseCurrency) {
            return $isPaymentSet;
        }

        if (null !== $newActivePaymentMethod->fieldValueOriginal) {
            $convertedValue = \TdbPkgShopCurrency::ConvertToActiveCurrency($newActivePaymentMethod->fieldValueOriginal);
            if ($convertedValue === $newActivePaymentMethod->GetPrice()) {
                return $isPaymentSet;
            }
        }

        $reloadedPayment = \TdbShopPaymentMethod::GetNewInstance($newActivePaymentMethod->id);
        parent::SetActivePaymentMethod($reloadedPayment);

        return $isPaymentSet;
    }