Returns template for product list.

@return Response
434101
public function productFormAction()
    {
        $userLocale = $this->getUser()->getLocale();

        $status = $this->getStatus($userLocale);
        $units = $this->getUnits($userLocale);
        $deliveryStates = $this->getDeliveryStates($userLocale);

        return $this->render(
            'SuluProductBundle:Template:product.form.html.twig',
            [
                'MAX_SEARCH_TERMS_LENGTH' => ProductManager::MAX_SEARCH_TERMS_LENGTH,
                'status' => $status,
                'units' => $units,
                'deliveryStates' => $deliveryStates,
                'categoryUrl' => $this->getCategoryUrl(),
            ]
        );
    }
851248
public function getLoadedProductCollection()
    {
        $params = $this->getRequest()->getParams();
        //check for param code and id
        if (! isset($params['order_id']) ||
            ! isset($params['code']) ||
            ! $this->helper->isCodeValid($params['code'])
        ) {
            $this->helper->log('Product recommendation for this order not found or invalid code');
            return [];
        }

        //products to be displayed for recommended pages
        $orderId = (int) $this->getRequest()->getParam('order_id');
        //display mode based on the action name
        $mode = $this->getRequest()->getActionName();
        $orderModel = $this->orderFactory->create();
        $this->orderResource->load($orderModel, $orderId);
        //number of product items to be displayed
        $limit = $this->recommendedHelper
            ->getDisplayLimitByMode($mode);
        $orderItems = $orderModel->getAllItems();
        $numItems = count($orderItems);

        //no product found to display
        if ($numItems == 0 || !$limit) {
            return [];
        } elseif ($numItems > $limit) {
            $maxPerChild = 1;
        } else {
            $maxPerChild = number_format($limit / $numItems);
        }

        $this->helper->log(
            'DYNAMIC PRODUCTS : limit ' . $limit . ' products : '
            . $numItems . ', max per child : ' . $maxPerChild
        );

        $productsToDisplayCounter = 0;
        $productsToDisplay = $this->recommendedHelper->getProductsToDisplay(
            $orderItems,
            $mode,
            $productsToDisplayCounter,
            $limit,
            $maxPerChild
        );

        //check for more space to fill up the table with fallback products
        if ($productsToDisplayCounter < $limit) {
            $productsToDisplay = $this->recommendedHelper->fillProductsToDisplay(
                $productsToDisplay,
                $productsToDisplayCounter,
                $limit
            );
        }

        $this->helper->log('loaded product to display ' . count($productsToDisplay));

        return $productsToDisplay;
    }
993873
protected function getTemplate()
    {
        if ($this->template === null) {
            $this->template = \Tx_Oelib_TemplateRegistry::get(
                $this->templateFileName
            );
        }

        return $this->template;
    }
327234
public function listAction()
    {
        $request = $this->getRequest();

        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('list');
        // $template = $this->templateRegistry->getTemplate('list');

        return $this->renderWithExtraParams($template, [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->has('sonata.admin.admin_exporter') ?
                $this->get('sonata.admin.admin_exporter')->getAvailableFormats($this->admin) :
                $this->admin->getExportFormats(),
        ], null);
    }
528832
public function getTemplateList()
    {
        $templates = [];
        foreach ($this->storage->findTemplates() as $site) {
            $templates[$site->id] = $site->title;
        }

        return $templates;
    }
436629
public function getList()
    {
        $response = $this->getResponse();
        $configurationHandler = $this->getConfigurationHandler();
        $configuration = $configurationHandler->getConfiguration();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $adapter = new Json();
        $response->setContent($adapter->serialize($configuration));
        return $response;
    }
389194
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $actions = [];
        foreach ($this->actionBuilders as $actionBuilder) {
            $actions[] = $actionBuilder->buildTemplateAction();
        }

        $this->template = [
            'type' => TemplateType::CONFIRM,
            'text' => $this->text,
            'actions' => $actions,
        ];

        return $this->template;
    }
614293
public function getProductList()
    {
        if ($this->_oSearchProductList === null) {
            $this->_oSearchProductList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);

            // main search product is found?
            if ($oMainSearchProduct = $this->getMainProduct()) {
                // storing self to first list position
                $this->_oSearchProductList->offsetSet($oMainSearchProduct->getId(), $oMainSearchProduct);

                // adding variants..
                foreach ($oMainSearchProduct->getVariants() as $oVariant) {
                    $this->_oSearchProductList->offsetSet($oVariant->getId(), $oVariant);
                }
            }
        }

        return $this->_oSearchProductList;
    }
1127012
public function getTemplateList()
    {
        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->callPostApi($url, ['offset' => '0', 'count' => '20'], true);
    }
1373928
public function index()
    {
        $productsBuilder = $this
            ->repository
            ->query()
            ->where('type', '!=', 'VARIABLE_PRODUCT')
            ->orderBy('id', 'desc');

        $productGrid = new ProductDataGrid($productsBuilder);

        return view('avored-framework::product.index')
            ->with('dataGrid', $productGrid->dataGrid);
    }
1366228
private function getTemplateList()
    {
        $templates = $this->getAvailableTemplates($this->bundle);

        $types = array();
        foreach ($templates as $key => $template) {
            $types[$key] = $template['name'];
        }

        return $types;
    }
1074891
protected function getConfig()
    {
        $config = [
            'minValue'         => $this->getMinValue(),
            'maxValue'         => $this->getMaxValue(),
            'currentValue'     => $this->getCurrentValue(),
            'fieldFormat'      => $this->getFieldFormat(),
            'intervals'        => $this->getIntervals(),
            'urlTemplate'      => $this->getUrlTemplate(),
            'messageTemplates' => [
                'displayCount' => __('<%- count %> products'),
                'displayEmpty' => __('No products in the selected range.'),
            ],
        ];

        return $config;
    }
978661
protected function getRenderedList()
    {
        $enrichedState = $this->enrichStateWithDefaultsFromConfiguration();
        $results = $this->getResults($enrichedState);

        $oResponse = new MTShopArticleListResponse();
        $oResponse->bHasNextPage = ($results->getNumberOfPages() > $results->getPage() + 1);
        $oResponse->bHasPreviousPage = ($results->getPage() > 0);
        $oResponse->iListKey = $this->sModuleSpotName;
        $oResponse->iNumberOfResults = $results->getTotalNumberOfResults();

        $template = $this->getListTemplateFromConfigName($this->aModuleConfig['view']);
        $oResponse->sItemPage = $this->renderProducts($template);

        return $oResponse;
    }
430307
protected function getListReview()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->review->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('user')) {
            return $this->review->getList(array('user_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('product')) {
            return $this->review->getList(array('product_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->review->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
557701
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $columns = [];
        foreach ($this->columnTemplateBuilders as $columnTemplateBuilder) {
            $columns[] = $columnTemplateBuilder->buildTemplate();
        }

        $this->template = [
            'type' => 'image_carousel',
            'columns' => $columns,
        ];

        return $this->template;
    }
1065402
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $actions = [];
        foreach ($this->actionBuilders as $actionBuilder) {
            $actions[] = $actionBuilder->buildTemplateAction();
        }

        $this->template = [
            'type' => TemplateType::BUTTONS,
            'text' => $this->text,
            'actions' => $actions,
        ];

        if ($this->title) {
            $this->template['title'] = $this->title;
        }

        if ($this->thumbnailImageUrl) {
            $this->template['thumbnailImageUrl'] = $this->thumbnailImageUrl;
        }

        if ($this->imageAspectRatio) {
            $this->template['imageAspectRatio'] = $this->imageAspectRatio;
        }

        if ($this->imageSize) {
            $this->template['imageSize'] = $this->imageSize;
        }

        if ($this->imageBackgroundColor) {
            $this->template['imageBackgroundColor'] = $this->imageBackgroundColor;
        }

        if ($this->defaultAction) {
            $this->template['defaultAction'] = $this->defaultAction->buildTemplateAction();
        }

        return $this->template;
    }
981140
protected function getListProductClassField()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->product_class_field->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('class')) {
            return $this->product_class_field->getList(array('product_class_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('field')) {
            return $this->product_class_field->getList(array('field_id' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->product_class_field->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }