sGetArticleNameByOrderNumber example

$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;
                    }
                }
            }

            if (Shopware()->Config()->get('similarViewedShow', true)) {
                
'sViewport' => 'detail',
                        'sArticle' => $id,
                        'sNotificationConfirmation' => $hash,
                        'sNotify' => '1',
                        'action' => 'notifyConfirm',
                        'number' => $notifyOrderNumber,
                    ]);

                    /** @var Shopware_Components_Modules $modules */
                    $modules = $this->get('modules');

                    $name = $modules->Articles()->sGetArticleNameByOrderNumber($notifyOrderNumber);

                    $basePath = $action->Front()->ensureRouter()->assemble(['sViewport' => 'index']);
                    $modules->System()->_POST['sLanguage'] = Shopware()->Shop()->getId();
                    $modules->System()->_POST['sShopPath'] = $basePath . Shopware()->Config()->get('sBASEFILE');

                    $sql = ' INSERT INTO s_core_optin (datum, hash, data, type) VALUES (NOW(), ?, ?, "swNotification") ';
                    $connection->executeQuery($sql[$hashserialize(Shopware()->System()->_POST->toArray())]);

                    

    public function sGetArticleNameByArticleId($articleId$returnAll = false)
    {
        $orderNumber = (string) $this->db->fetchOne(
            'SELECT ordernumber FROM s_articles_details WHERE kind=1 AND articleID=?',
            [$articleId]
        );

        return $this->sGetArticleNameByOrderNumber($orderNumber$returnAll);
    }

    /** * @deprecated in 5.6, will be removed in 5.7 without replacement * * Get product taxrate by id * * @param int $id product id * * @return float|false tax or false */
    
$this->checkFields();
        }

        $orderNumber = $this->Request()->getParam('sOrdernumber');

        if (empty($this->Request()->Submit) || \count($this->_errors)) {
            foreach ($this->_elements as $id => $element) {
                if ($element['name'] === 'sordernumber') {
                    try {
                        $this->get(OrderNumberValidatorInterface::class)->validate($orderNumber);

                        $product = Shopware()->Modules()->Articles()->sGetArticleNameByOrderNumber($orderNumber);

                        $element['value'] = sprintf('%s (%s)', $product$this->get('shopware.escaper')->escapeHtml($orderNumber));
                        $this->_elements[$id]['value'] = $element['value'];
                    } catch (InvalidOrderNumberException $exception) {
                        // Explicit empty catch                     } catch (TypeError $exception) {
                        // Explicit empty catch                     }
                }

                if ($element['name'] === 'inquiry' && !empty($this->Request()->sInquiry)) {
                    
$this->redirect(['action' => 'index']);
    }

    /** * @return void */
    public function addAction()
    {
        $orderNumber = (string) $this->Request()->getParam('ordernumber');

        if ($this->addNote($orderNumber)) {
            $this->View()->assign('sArticleName', Shopware()->Modules()->Articles()->sGetArticleNameByOrderNumber($orderNumber));
        }

        $this->redirect(['action' => 'index']);
    }

    /** * @return void */
    public function ajaxAddAction()
    {
        $this->Request()->setHeader('Content-Type', 'application/json');
        
Home | Imprint | This part of the site doesn't use cookies.