addAdditionalTextForVariant example

$builder->addOrderBy($property['property']$property['direction']);
        }

        $builder->setFirstResult($this->Request()->getParam('start'))
            ->setMaxResults($this->Request()->getParam('limit'))
            ->orderBy('details.id', 'ASC');

        $result = $builder->execute()->fetchAll(PDO::FETCH_ASSOC);

        $total = (int) $builder->getConnection()->fetchColumn('SELECT FOUND_ROWS()');

        $result = $this->addAdditionalTextForVariant($result);

        foreach ($result as $index => $variant) {
            $result[$index]['price'] = round($variant['price'] / 100 * (100 + $variant['tax']), 2);
        }

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

    /** * Returns a list of all backend-users. Supports store paging, sorting and filtering over the standard ExtJs store parameters. * Each user has the following fields: * <code> * [int] id * [int] roleId * [string] username * [string] password * [int] localeId * [string] sessionId * [date] lastLogin * [string] name * [string] email * [int] active * [int] failedLogins * [date] lockedUntil * </code> */

        }

        $builder->setFirstResult($this->Request()->getParam('start'))
            ->setMaxResults($this->Request()->getParam('limit'))
            ->orderBy('details.id', 'ASC');

        $result = $builder->execute()->fetchAllAssociative();

        $total = (int) $builder->getConnection()->fetchOne('SELECT FOUND_ROWS()');

        $result = $this->addAdditionalTextForVariant($result);

        foreach ($result as $index => $variant) {
            $taxRule = $shopContext->getTaxRule($variant['taxId']);
            if ($taxRule instanceof TaxStruct) {
                $result[$index]['tax'] = (float) $taxRule->getTax();
            }

            $result[$index]['price'] = $customerGroup->getTax() === true ? round((float) $variant['price'] / 100 * (100 + $result[$index]['tax']), 2) : round((float) $variant['price'], 2);
        }

        $this->View()->assign(['success' => true, 'data' => $result, 'total' => $total]);
    }
Home | Imprint | This part of the site doesn't use cookies.