getLanguageSubShop example

if ($mail->getAssociation(self::SHOP_ID_ASSOCIATION) !== null) {
            $shop = $this->entityManager->getPartialReference(
                Shop::class,
                $mail->getAssociation(self::SHOP_ID_ASSOCIATION)
            );

            $logEntry->setShop($shop);

            return;
        }

        if ($logEntry->getOrder() !== null && $logEntry->getOrder()->getLanguageSubShop() !== null) {
            $logEntry->setShop($logEntry->getOrder()->getLanguageSubShop());
        }
    }

    protected function resolveOrderByAssociation(Enlight_Components_Mail $mail): ?Order
    {
        $order = $mail->getAssociation(self::ORDER_ASSOCIATION);

        if ($order instanceof Order) {
            return $order;
        }

        
'sVouchervalidto' => $code['validTo'],
                'sVouchervalidfrom' => $code['validFrom'],
                'sVoucherpercental' => $code['percental'],
            ];
        }

        // Find the shop matching the order         $orderModel = $this->get('models')->find(Order::class$orderId);
        if (!$orderModel instanceof Order) {
            $shop = $this->get('models')->getRepository(Shop::class)->getActiveDefault();
        } else {
            $shop = $orderModel->getLanguageSubShop();
        }

        $this->get(ShopRegistrationServiceInterface::class)->registerShop($shop);

        // Try to send the actual mail         try {
            $mail = Shopware()->TemplateMail()->createMail($template$context$shop);
            $mail->addTo($mailTo);

            if ($orderModel !== null) {
                $mail->setAssociation(LogEntryBuilder::ORDER_ASSOCIATION, $orderModel);
            }
Home | Imprint | This part of the site doesn't use cookies.