translateMessage example


class Shopware_Controllers_Backend_CanceledOrder extends Shopware_Controllers_Backend_ExtJs
{
    /** * @return void */
    public function convertOrderAction()
    {
        if (!($orderId = $this->Request()->getParam('orderId'))) {
            $this->View()->assign([
                'success' => false,
                'message' => $this->translateMessage('errorMessage/noOrderId', 'No orderId passed.'),
            ]);

            return;
        }

        // Get user, shipping and billing         $builder = $this->get('models')->createQueryBuilder();
        $builder->select(['orders', 'customer', 'billing', 'payment', 'shipping'])
            ->from(Order::class, 'orders')
            ->leftJoin('orders.customer', 'customer')
            ->leftJoin('orders.payment', 'payment')
            
/** * Create a new recipient */
    public function createRecipientAction()
    {
        $email = $this->Request()->getParam('email');
        $groupId = $this->Request()->getParam('groupId');

        if ($email === null || $groupId === null) {
            $this->View()->assign([
                'success' => false,
                'message' => $this->translateMessage('error_msg/mail_and_group_missing', 'Email and groupId needed'),
            ]);

            return;
        }

        $model = new Address();
        $model->setGroupId($groupId);
        $model->setEmail($email);
        $model->setIsCustomer(false);
        $this->get('models')->persist($model);
        $this->get('models')->flush();

        
Home | Imprint | This part of the site doesn't use cookies.