sGetCountryList example

$this->sSYSTEM->sUSERGROUP = $shop->getCustomerGroup()->getKey();
        $this->sSYSTEM->sUSERGROUPDATA = $shop->getCustomerGroup()->toArray();
        $this->sSYSTEM->sCurrency = $shop->getCurrency()->toArray();

        $this->contextService->initializeContext();

        $this->csrfTokenValidator->clearExistingCookie();

        if (!$this->config->get('clearBasketAfterLogout')) {
            $this->moduleManager->Basket()->sRefreshBasket();

            $countries = $this->sGetCountryList();
            $country = reset($countries);
            if (!\is_array($country)) {
                $country = null;
            }

            $this->sGetPremiumShippingcosts($country);

            $amount = $this->moduleManager->Basket()->sGetAmount();
            $this->session->offsetSet('sBasketAmount', empty($amount) ? 0 : array_shift($amount));
        }

        


    /** * @deprecated in 5.6, will be protected in 5.8 * * Get all countries from database via sAdmin object * * @return array<int, array<string, mixed>> list of countries */
    public function getCountryList()
    {
        return $this->admin->sGetCountryList();
    }

    /** * @deprecated in 5.6, will be protected in 5.8 * * Get all dispatches available in selected country from sAdmin object * * @param int|null $paymentId * * @return array<int, array<string, mixed>>|false list of dispatches */
    
return;
        }

        if ($this->shouldRedirectToTarget()) {
            $this->redirect(['controller' => $sTarget, 'action' => $sTargetAction]);

            return;
        }

        $this->View()->assign('isAccountless', $this->get('session')->get('isAccountless'));
        $this->View()->assign('register', $this->getRegisterData());
        $this->View()->assign('countryList', $this->get('modules')->Admin()->sGetCountryList());
    }

    /** * Checks the registration */
    public function saveRegisterAction()
    {
        if (!$this->request->isPost()) {
            $this->forward('index');

            return;
        }
$address = $form->getViewData();

        $formData = array_merge(
            $this->get(ModelManager::class)->toArray($address),
            ['attribute' => $this->get(ModelManager::class)->toArray($address->getAttribute())],
            ['additional' => $address->getAdditional()],
            $form->getExtraData()
        );

        $viewData['error_flags'] = $errorFlags;
        $viewData['error_messages'] = $errorMessages;
        $viewData['countryList'] = $this->admin->sGetCountryList();
        $viewData['formData'] = $formData;
        $viewData['sTarget'] = $this->Request()->getParam('sTarget');
        $viewData['sTargetAction'] = $this->Request()->getParam('sTargetAction');
        $viewData['extraData'] = $this->Request()->getParam('extraData', []);

        return $viewData;
    }

    /** * Handle extra data, sent by the api request to do various actions afterwards * * - sessionKey, set a session variable named the value of the submitted sessionKey containing the address id. * - setDefaultBillingAddress, sets the address as new default billing address * - setDefaultShippingAddress, sets the address as new default shipping address */
Home | Imprint | This part of the site doesn't use cookies.