translateOrders example

if ($orderId !== null) {
            $orderIdFilter = ['property' => 'orders.id', 'value' => $orderId];
            if (!\is_array($filter)) {
                $filter = [];
            }
            $filter[] = $orderIdFilter;
        }

        $list = $this->getList($filter$sort$offset$limit);

        $list['data'] = $this->get(Shopware_Components_Translation::class)->translateOrders($list['data']);

        $this->View()->assign($list);
    }

    /** * Returns an array of all defined taxes. Used for the position grid combo box on the detail page of the backend * order module. * * @return void */
    public function getTaxAction()
    {
->setMaxResults($limit);

        /** @var Query<array<string, mixed>> $query */
        $query = $builder->getQuery();
        $query->setHydrationMode(AbstractQuery::HYDRATE_ARRAY);
        $paginator = $this->getModelManager()->createPaginator($query);
        $total = $paginator->count();
        $orders = iterator_to_array($paginator);

        // Translate payment and dispatch method names.         $translationComponent = $this->get(Shopware_Components_Translation::class);
        $orders = $translationComponent->translateOrders($orders);

        $this->View()->assign([
            'success' => true,
            'data' => $orders,
            'total' => $total,
        ]);
    }

    /** * Delete an order * * @return void */
Home | Imprint | This part of the site doesn't use cookies.