offsetSet example

$email = $this->sUserData['additional']['user']['email'];
            $this->logOrderMailException($e$orderNumber$email);
        }

        // Check if voucher is affected         $this->sTellFriend();

        if ($this->getSession()->offsetExists('sOrderVariables')) {
            $variables = $this->getSession()->offsetGet('sOrderVariables');
            $variables['sOrderNumber'] = $orderNumber;
            $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;
            $this->getSession()->offsetSet('sOrderVariables', $variables);
        }

        $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [
            'subject' => $this,
            'details' => $this->sBasketData[CartKey::POSITIONS],
            'orderId' => $orderID,
            'orderNumber' => $orderNumber,
        ]);

        return $orderNumber;
    }

    
  public function offsetGet($offset) {
    @trigger_error($this->message, E_USER_DEPRECATED);
    return parent::offsetGet($offset);
  }

  /** * {@inheritdoc} */
  #[\ReturnTypeWillChange]   public function offsetSet($offset$value) {
    @trigger_error($this->message, E_USER_DEPRECATED);
    parent::offsetSet($offset$value);
  }

  /** * {@inheritdoc} */
  #[\ReturnTypeWillChange]   public function offsetUnset($offset) {
    @trigger_error($this->message, E_USER_DEPRECATED);
    parent::offsetUnset($offset);
  }

  
if (\in_array((int) $position['modus'][CartPositionsMode::PRODUCT, CartPositionsMode::PREMIUM_PRODUCT], true)) {
                $kind = (int) $position['kind'];
                $translation = $translator->read(
                    $orderLocale,
                    $kind === 1 ? 'article' : 'variant',
                    $position[$kind === 1 ? 'articleID' : 'articleDetailID']
                );

                $position = $this->assignAttributeTranslation($position$translation);
            }

            $this->_positions->offsetSet($key$position);
        }
    }

    /** * Get maximum used tax-rate in this order * * @return int|string */
    public function getMaxTaxRate()
    {
        $maxTax = 0;

        

    public function setParameter($name$value)
    {
        $config = $this->pimple->offsetGet('config');
        $config[$name] = $value;

        $this->pimple->offsetSet('config', $config);
    }
}
public function afterLogout()
    {
        if (!$this->container->initialized('front')) {
            return;
        }

        /** @var Enlight_Controller_Front $controller */
        $controller = $this->container->get('front');

        if ($this->container->initialized('session')) {
            $session = $this->container->get('session');
            $session->offsetSet('auto-user', null);
        }

        $controller->Response()->headers->setCookie(
            new Cookie('slt', null, strtotime('-1 Year')$controller->Request()->getBasePath() . '/')
        );
    }

    public function checkCookie(Enlight_Controller_EventArgs $args)
    {
        $request = $args->getRequest();

        

    public function __get(string $name): mixed
    {
        return $this->offsetGet($name);
    }

    /** * @internal */
    public function __set(string $name, mixed $value): void
    {
        $this->offsetSet($name$value);
    }

    /** * @internal */
    public function offsetExists(mixed $property): bool
    {
        return \property_exists($this->product, $property);
    }

    /** * @internal */
int $categoryId,
        ShopContextInterface $context,
        Enlight_Controller_Request_Request $request,
        Criteria $criteria
    ): array {
        $conditions = $criteria->getConditionsByClass(VariantCondition::class);
        $conditions = array_filter($conditionsfunction DVariantCondition $condition) {
            return $condition->expandVariants();
        });

        if (\count($conditions) > 0) {
            $this->config->offsetSet('forceArticleMainImageInListing', 0);
            $searchResult = $this->searchService->search($criteria$context);
            $this->config->offsetSet('forceArticleMainImageInListing', 1);
        } else {
            $searchResult = $this->searchService->search($criteria$context);
        }

        $products = [];
        foreach ($searchResult->getProducts() as $productStruct) {
            $product = $this->legacyStructConverter->convertListProductStruct($productStruct);

            if (!empty($categoryId) && $categoryId != $context->getShop()->getCategory()->getId()) {
                
->getAlbumWithSettingsQuery(-1)
            ->getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT);

        if ($this->sCurrency === false) {
            throw new RuntimeException('Currency could not be fetched correctly.');
        }
        $currency = Shopware()->Models()->getRepository(Currency::class)->find($this->sCurrency['id']);
        $shop->setCurrency($currency);
        Shopware()->Container()->get(ShopRegistrationServiceInterface::class)->registerShop($shop);

        if ($this->sCustomergroup !== false) {
            Shopware()->Container()->get('session')->offsetSet('sUserGroup', $this->sCustomergroup['groupkey']);
        }

        $this->contextService->initializeContext();

        $this->shop = $shop;

        $this->sSYSTEM->sCONFIG = $this->config;
    }

    /** * @return void */

        return $this->offsetGet($name);
    }

    /** * Magic setter * * @param string $name */
    public function __set($name$value)
    {
        $this->offsetSet($name$value);
    }

    /** * Magic caller method * * @param string $name * @param array $args */
    public function __call($name$args = null)
    {
        return $this->get($name);
    }
if (!isset(Shopware()->System()->_POST['newsletter'])) {
            return;
        }

        if (Shopware()->System()->_POST['subscribeToNewsletter'] != 1) {
            // Unsubscribe user             $this->View()->assign('sStatus', Shopware()->Modules()->Admin()->sNewsletterSubscription(Shopware()->System()->_POST['newsletter'], true));

            $session = $this->container->get('session');
            if ($session->offsetExists('sNewsletter')) {
                $session->offsetSet('sNewsletter', false);
            }

            return;
        }

        $config = $this->container->get(Shopware_Components_Config::class);
        $noCaptchaAfterLogin = $config->get('noCaptchaAfterLogin');
        // redirect user if captcha is active and request is sent from the footer         if (strtolower($config->get('newsletterCaptcha')) !== 'nocaptcha'
            && $this->Request()->getPost('redirect') !== null
            && !($noCaptchaAfterLogin && Shopware()->Modules()->Admin()->sCheckUser())) {
            
$_SESSION['parameters'] = [];
}

if (isset($_SESSION['databaseConnectionInfo'])) {
    $connectionInfo = $_SESSION['databaseConnectionInfo'];

    try {
        $databaseFactory = new DatabaseFactory();
        $connection = $databaseFactory->createPDOConnection($connectionInfo);

        // Init db in container         $container->offsetSet('db', $connection);
    } catch (\Exception $e) {
        // Jump to form         throw $e;
    }
}

/** * @return array|string */
function selectLanguage(array $allowedLanguages)
{
    
return $shop;
    }

    /** * @return PDO */
    protected function initDatabaseConnection(DatabaseConnectionInformation $connectionInfo, Container $container)
    {
        $databaseFactory = new DatabaseFactory();
        $conn = $databaseFactory->createPDOConnection($connectionInfo);
        $container->offsetSet('db', $conn);

        return $conn;
    }

    /** * @return bool */
    protected function shouldSkipImport()
    {
        if (!$this->IOHelper->isInteractive()) {
            return true;
        }
if (!$response->isException()) {
            return;
        }

        $this->isInsideErrorHandlerLoop = true;

        // Get exception information         $error = new ArrayObject([], ArrayObject::ARRAY_AS_PROPS);
        $exceptions = $response->getException();
        $exception = $exceptions[0];
        $error->offsetSet('exception', $exception);

        // Keep a copy of the original request         $error->offsetSet('request', clone $request);

        // Get a count of the number of exceptions encountered         $this->exceptionCountAtFirstEncounter = \count($exceptions);

        // Forward to the error handler         $request->setParam('error_handler', $error)
            ->setControllerName('error')
            ->setActionName('error')
            
Shopware()->Session()->set('Bot', $plugin->checkIsBot($request->getHeader('USER_AGENT') ?: ''));
            }
            $system->sBotSession = Shopware()->Session()->get('Bot');
        }

        if (Shopware()->Container()->initialized('shop')) {
            $shop = Shopware()->Shop();
            $system->sCurrency = $shop->getCurrency()->toArray();

            $system->sUSERGROUP = $shop->getCustomerGroup()->getKey();
            $system->sUSERGROUPDATA = $shop->getCustomerGroup()->toArray();
            $config->offsetSet('defaultCustomerGroup', $system->sUSERGROUP);

            $config['sCURRENCY'] = $system->sCurrency['currency'];
            $config['sCURRENCYHTML'] = $system->sCurrency['symbol'];
        }

        if (Shopware()->Container()->initialized('session')) {
            if (!empty(Shopware()->Session()->get('sUserGroup'))
                    && Shopware()->Session()->get('sUserGroup') !== $system->sUSERGROUP) {
                $system->sUSERGROUP = Shopware()->Session()->get('sUserGroup');
                $system->sUSERGROUPDATA = Shopware()->Db()->fetchRow(' SELECT * FROM s_core_customergroups WHERE groupkey = ? ',

        $this->validatePostMethod();

        $orderNumber = trim($this->Request()->getParam('sAdd'));
        $quantity = (int) $this->Request()->getParam('sQuantity');
        $productId = Shopware()->Modules()->Articles()->sGetArticleIdByOrderNumber($orderNumber);
        $instockInfo = $this->getInstockInfo($orderNumber$quantity);

        $this->View()->assign('sBasketInfo', $instockInfo);

        if ($instockInfo !== null) {
            $this->session->offsetSet('sErrorMessages', $instockInfo);
        }

        if (!empty($productId)) {
            $insertId = $this->basket->sAddArticle($orderNumber$quantity);
            $this->View()->assign('sArticleName', Shopware()->Modules()->Articles()->sGetArticleNameByOrderNumber($orderNumber));
            if (!empty($insertId)) {
                $basket = $this->getBasket();
                foreach ($basket[CartKey::POSITIONS] ?? [] as $item) {
                    if ((int) $item['id'] === $insertId) {
                        $this->View()->assign('sArticle', $item);
                        break;
                    }
Home | Imprint | This part of the site doesn't use cookies.