sGetPremiumShippingcosts example


    public function sRefreshBasket()
    {
        // Update basket data         $this->moduleManager->Admin()->sGetUserData();
        $this->sGetBasket();
        $this->moduleManager->Admin()->sGetPremiumShippingcosts();

        // Update basket data in session         $this->session->offsetSet('sBasketCurrency', Shopware()->Shop()->getCurrency()->getId());
        $this->session->offsetSet('sBasketQuantity', $this->sCountBasket());
        $amount = $this->sGetAmount();
        $this->session->offsetSet('sBasketAmount', empty($amount) ? 0 : array_shift($amount));
    }

    /** * Checks if the vouchers on the current basket have already been used. * Return true if the current cart doesn't have a voucher or if the voucher is valid * Returns false if the current voucher has already been used. * * @param string $sessionId * @param int $userId * * @return bool */
if (empty($this->get('session')->get('sUserId'))) {
            $modules->System()->sUSERGROUP = $shop->getCustomerGroup()->getKey();
            $modules->System()->sUSERGROUPDATA = $shop->getCustomerGroup()->toArray();
            $modules->System()->sCurrency = $shop->getCurrency()->toArray();
        }

        $this->get(ContextServiceInterface::class)->initializeContext();

        $shopContext = $this->get(ContextServiceInterface::class)->getShopContext();

        $modules->Basket()->sRefreshBasket();
        $modules->Admin()->sGetPremiumShippingcosts($shopContext->getCountry() ? $shopContext->getCountry()->jsonSerialize() : null);

        $amount = $modules->Basket()->sGetAmount();
        $this->get('session')->offsetSet('sBasketAmount', empty($amount) ? 0 : array_shift($amount));
    }
}
$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));
        }

        $this->eventManager->notify('Shopware_Modules_Admin_Logout_Successful');
    }

    /** * Attempt to login a user in the frontend * Used for login and registration in frontend, also for user impersonation * from backend * * @param bool $ignoreAccountMode Allows customers who have chosen * the fast registration, one-time login after registration * * @throws Exception If no password encoder is specified * * @return array|false Array with errors that may have occurred, or false if * the process is interrupted by an event */

    public function getShippingCosts()
    {
        $country = $this->getSelectedCountry();
        $payment = $this->getSelectedPayment();
        if (empty($country) || empty($payment)) {
            return sAdmin::NO_SHIPPING_COSTS;
        }
        $shippingCosts = $this->admin->sGetPremiumShippingcosts($country);

        return empty($shippingCosts) ? sAdmin::NO_SHIPPING_COSTS : $shippingCosts;
    }

    /** * @deprecated in 5.6, will be protected in 5.8 * * Return complete basket data to view * Basket items / Shippingcosts / Amounts / Tax-Rates * * @param bool $mergeProportional * * @return array<string, mixed> * * @phpstan-return CheckoutBasketArray */
Home | Imprint | This part of the site doesn't use cookies.