bb-legacy/controllers/front/categoryController.php line 43

Open in your IDE?
  1. <?php
  2. use App\Application\Service\ElasticSearch\ElasticSearchService;
  3. use App\Application\Service\Taxonomy\TaxonomyService;
  4. use App\Application\Service\Taxonomy\TaxonomyTreeService;
  5. use App\Client\Cdn\Factory\ImageUrlFactory;
  6. use App\Entity\System\Tag;
  7. use App\ViewManager\Landing\ViewService;
  8. use Symfony\Contracts\Translation\TranslatorInterface;
  9. use Twig\Environment;
  10. class categoryController extends Controller
  11. {
  12.     /** @var \Category */
  13.     protected $_object;
  14.     public const ORDER_BY_SCORE_DESC = -1;
  15.     public const LIMIT_PRODS_ES 1000;
  16.     public const INIT_ES 0;
  17.     /** @var TaxonomyTreeService */
  18.     private $taxonomyTreeService;
  19.     /** @var TaxonomyService */
  20.     private $taxonomyService;
  21.     /** @var TranslatorInterface */
  22.     private $translator;
  23.     /** @var ViewService */
  24.     private $viewService;
  25.     /** @var Environment */
  26.     private $twig;
  27.     public function __construct($id null)
  28.     {
  29.         parent::__construct('Category'$id);
  30.         $this->taxonomyTreeService Tools::getSfService(TaxonomyTreeService::class);
  31.         $this->taxonomyService Tools::getSfService(TaxonomyService::class);
  32.         $this->translator Tools::getSfService('translator');
  33.         $this->twig Tools::getSfService('twig');
  34.         $this->viewService Tools::getSfService(ViewService::class);
  35.     }
  36.     public function index()
  37.     {
  38.     }
  39.     public function landingpage()
  40.     {
  41.         if (!Tools::getSfParameter('is_staging')) {
  42.             \Sentry\captureException(new \Exception('Using legacy category controller'));
  43.         }
  44.         $home_category App\Entity\System\Category::HOME_ID;
  45.         $sections = [];
  46.         $categTree Category::getCategory($this->_object->id'_layout0_Array', []);
  47.         $categChilds $categTree['selcat_childs'];
  48.         $allTaxonomiesForLanguageID $this->taxonomyService->getAllCachedTaxonomiesForLanguage(Session::get('id_lang'));
  49.         $categTree $this->taxonomyTreeService->getLegacyTree($allTaxonomiesForLanguageIDSession::get('lang'), []);
  50.         $mainCategory = (intval($this->_object->id_parent) === intval($home_category));
  51.         // RECORREMOS EL LISTADO DE CATEGORIAS Y EXTRAEMOS LA PRIMERA PARA SELECCIONAR
  52.         $category_aux = [];
  53.         foreach ($categTree['_layout0_Array'] as $cat) {
  54.             if ($cat['id'] != $this->_object->id) {
  55.                 array_push($category_aux$cat);
  56.             } else {
  57.                 array_unshift($category_aux$cat);
  58.             }
  59.         }
  60.         $categTree['_layout0_Array'] = $category_aux;
  61.         $mainavLinks Category_mainav_link::getIdLinks($this->_object->id);
  62.         if ($mainavLinks) {
  63.             $this->category_mainav $this->_object->id;
  64.             $this->category_mainav_links $mainavLinks;
  65.         } else {
  66.             if ($mainCategory) {
  67.                 $this->category_mainav $this->_object->id;
  68.                 $this->category_mainav_links = []; // Mostramos siempre las categorías hijo
  69.             }
  70.         }
  71.         $this->addJs([
  72.             ['value' => 'public/js/tools.js?t=201606071238'],
  73.             ['value' => 'public/js/categorylandingpage.js?t=201606071238'],
  74.             ['value' => 'var filterMobile=0;',
  75.                              'code'  => true],
  76.         ]);
  77.         $vars = [];
  78.         $vars['categMenuList'] = [];
  79.         $vars['_partials0'] = [
  80.             ['sections' => $sections],
  81.         ];
  82.         $vars['_layout1'] = [];
  83.         $vars['_layout1']['desc_category_extra'] = Tools::replaceAutomatedLinks($this->_object->description_extra[Session::get('id_lang')]);
  84.         $vars['_layout1']['_layout0_Array'] = $categTree['_layout0_Array'];
  85.         $vars['_layout2'] = [];
  86.         $vars['_layout2']['name_category'] = str_replace('|'''$this->_object->name[Session::get('id_lang')]);
  87.         $vars['_layout2']['desc_category'] = Tools::replaceAutomatedLinks($this->_object->description[Session::get('id_lang')]);
  88.         $vars['_layout2']['cat'] = $this->_object->id;
  89.         $vars['_layout2']['link_rewrite'] = $this->_object->link_rewrite[Session::get('id_lang')];
  90.         $vars['_layout2']['is_exception'] = (in_array($this->_object->idTools::jsonDecode(Configuration::get('CATEGORY_TEXT_EXCEPTION')))) ? true false;
  91.         $vars['_layout2']['_partials0'] = $categChilds;
  92.         $vars['_layout2']['childs'] = $categChilds;
  93.         $vars['_layout2']['childs_num_row'] = 3;
  94.         $countCategChild count($categChilds);
  95.         for ($nRow 4$nRow <= 5$nRow++) {
  96.             if (($countCategChild $nRow) === 0) {
  97.                 $vars['_layout2']['childs_num_row'] = $nRow;
  98.             }
  99.         }
  100.         if (Tools::isMobile()) {
  101.             $categoryBread array_slice($sections, -11);
  102.             $vars['_partials0'][0]['name'] = $categoryBread[0]['name'];
  103.             $vars['_partials0'][0]['arrow'] = false;
  104.             $vars['_partials0'][0]['linkCategory'] = false;
  105.             $vars['_layout1'] = 'not_display';
  106.             $this->addJs([
  107.                             ['value' => 'var filterMobile=0;',
  108.                                   'code'  => true],
  109.                             ]);
  110.         }
  111.         $this->_object->canonical Link::getCategoryLink($this->_object->id);
  112.         $this->setView('categoryLandingPage'$vars);
  113.     }
  114.     public function downloadcsv($type 'taxonomy'$supplier null)
  115.     {
  116.         $categoryId Tools::getValue('args');
  117.         $filters Tools::getValue('filters', []);
  118.         $init Tools::getValue('init'self::INIT_ES);
  119.         $limit Tools::getValue('limit'self::LIMIT_PRODS_ES);
  120.         $ajax Tools::getValue('ajax'false);
  121.         if ($supplier) {
  122.             $filters['featured'] = [0];
  123.         }
  124.         $resultProducts = [];
  125.         switch ($type) {
  126.             case 'taxonomy':
  127.                 $filters['taxonomy'] = [$categoryId];
  128.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'));
  129.                 $resultProducts $results['result'];
  130.                 break;
  131.             case 'new_products':
  132.                 $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_NEW_PRODUCTS);
  133.                 $resultProducts $viewFilters->getCategoryProducts();
  134.                 break;
  135.             case 'best_sellers':
  136.                 $filters['minRecentSales'] = 20;
  137.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'));
  138.                 $resultProducts $results['result'];
  139.                 break;
  140.             case 'new_stock':
  141.                 $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_NEW_STOCK_PRODUCTS);
  142.                 $resultProducts $viewFilters->getCategoryProducts();
  143.                 break;
  144.             case 'tag':
  145.                 $filters['tags'] = [$categoryId];
  146.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'));
  147.                 $resultProducts $results['result'];
  148.                 break;
  149.             case 'manufacturer':
  150.                 $filters['brands'] = [$categoryId];
  151.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'));
  152.                 $resultProducts $results['result'];
  153.                 break;
  154.             case 'bigstocks':
  155.                 $filters['bigStocks'] = 1;
  156.                 $sexAndSensualityTaxonomyId 17088;
  157.                 $eroticClothesTaxonomyId 16630;
  158.                 $filters['excludeTaxonomy'] = [$sexAndSensualityTaxonomyId$eroticClothesTaxonomyId];
  159.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'));
  160.                 $resultProducts $results['result'];
  161.                 break;
  162.             case 'search':
  163.                 $filters['order'] = [self::ORDER_BY_SCORE_DESC];
  164.                 $searchText str_replace('+'' '$categoryId);
  165.                 $results Tools::getResultsElasticSearch(Session::get('lang'), $init$limit$this->ajax$filtersSession::get('is_wholesaler'), $searchText);
  166.                 $resultProducts $results['result'];
  167.                 break;
  168.         }
  169.         $this->setDisplayFooter(false);
  170.         $this->setDisplayHeadAndHeader(false);
  171.         header('Content-disposition: attachment; filename=products.csv');
  172.         header('Content-type: application/octet-stream');
  173.         $csvArray = [];
  174.         $csvArray[0] = [
  175.             'sku' => 'sku',
  176.             'name' => 'name',
  177.             'images' => 'images',
  178.             'video' => 'video',
  179.             'stock1' => 'stock_a',
  180.             'stock1Days' => 'stock_a_days',
  181.             'stock2' => 'stock_b',
  182.             'stock2Days' => 'stock_b_days',
  183.             'stock3' => 'stock_c',
  184.             'stock3Days' => 'stock_c_days',
  185.             'pvd_old' => 'pvd_old',
  186.             'pvd' => 'pvd',
  187.             'pvd_dif' => 'pvd_dif',
  188.             'pvr_old' => 'pvr_old',
  189.             'pvr' => 'pvr',
  190.             'pvr_dif' => 'pvr_dif',
  191.             'category' => 'category',
  192.         ];
  193.         echo implode(';'$csvArray[0])."\r\n";
  194.         if (!empty($resultProducts)) {
  195.              try {
  196.                  $taxonomyManager Tools::getSfService(\App\Manager\System\TaxonomyManager::class);
  197.                  $sessionService Tools::getSfService(\App\Application\Service\Session\SessionService::class);
  198.                 foreach ($resultProducts as $key => $resultProduct) {
  199.                     $sincronizedDays = ($resultProduct['sincronized'] == && !empty($resultProduct['days']) && $resultProduct['days'] > 0) ? $resultProduct['days'] : 1;
  200.                     $stockMessage Tools::calculateDaysTransit($sincronizedDays$resultProduct['id_product']);
  201.                     $stockFutureMsg Tools::calculateDaysTransit(
  202.                         $resultProduct['days_future_stock'],
  203.                         $resultProduct['id_product']
  204.                     );
  205.                     $stockExternMessage Tools::calculateDaysTransit(
  206.                         $sincronizedDays,
  207.                         $resultProduct['id_product'],
  208.                         true
  209.                     );
  210.                     $pvdDif Tools::displayPrice(0false).'%';
  211.                     if ($resultProduct['price_after_old'] > 0) {
  212.                         $pvdDif Tools::displayPrice(
  213.                             (($resultProduct['price_after_old'] - $resultProduct['price_after']) / $resultProduct['price_after_old']) * 100,
  214.                             false
  215.                         ).'%';
  216.                     }
  217.                     $pvrDif Tools::displayPrice(0false).'%';
  218.                     if ($resultProduct['price_before_old'] > 0) {
  219.                         $pvrDif Tools::displayPrice((($resultProduct['price_before_old'] - $resultProduct['price_before']) / $resultProduct['price_before_old']) * 100false).'%';
  220.                     }
  221.                     $images explode(';'$resultProduct['name_image']);
  222.                     foreach ($images as &$image) {
  223.                         $image ImageUrlFactory::buildByImageName($image);
  224.                     }
  225.                     $images implode(','$images);
  226.                     if (is_array($resultProduct['reference'])) {
  227.                         $resultProduct['reference'] = end($resultProduct['reference']);
  228.                     }
  229.                     $stock1Days $stockMessage['days'] ?? 1;
  230.                     $stock2Days $stockFutureMsg['days'] ?? 5;
  231.                     $stock3Days $stockExternMessage['days'] ?? 1;
  232.                     $defaultTaxonomyId $resultProduct['id_taxonomy_default'] ?? null;
  233.                     $taxonomyName $defaultTaxonomyId ?
  234.                         $taxonomyManager->getTaxonomyInfo($defaultTaxonomyId$sessionService->get('id_lang')) : null;
  235.                     $csvArray[$resultProduct['id_product']] = [
  236.                         'sku' => $resultProduct['reference'],
  237.                         'name' => addslashes($resultProduct['name']),
  238.                         'images' => $images,
  239.                         'video' => !empty($resultProduct['video']) ? 'https://www.youtube.com/watch?v='.$resultProduct['video'] : '-',
  240.                         'stock1' => $resultProduct['quantity_immediate'] > $resultProduct['quantity_immediate'] : 0,
  241.                         'stock1Days' => $stock1Days,
  242.                         'stock2' => $resultProduct['quantity_future'] > $resultProduct['quantity_future'] : 0,
  243.                         'stock2Days' => $stock2Days,
  244.                         'stock3' => ($resultProduct['quantity_supplier'] - $resultProduct['quantity_extern']) > ? ($resultProduct['quantity_supplier'] - $resultProduct['quantity_extern']) : 0,
  245.                         'stock3Days' => $stock3Days,
  246.                         'pvd_old' => !empty($resultProduct['price_after_old']) && $resultProduct['price_after_old'] > Tools::displayPrice($resultProduct['price_after_old'], false) : '-',
  247.                         'pvd' => Tools::displayPrice($resultProduct['price_after'], false),
  248.                         'pvd_dif' => $pvdDif,
  249.                         'pvr_old' => !empty($resultProduct['price_before_old']) && $resultProduct['price_before_old'] > Tools::displayPrice($resultProduct['price_before_old'], false) : '-',
  250.                         'pvr' => Tools::displayPrice($resultProduct['price_before'], false),
  251.                         'pvr_dif' => $pvrDif,
  252.                         'category' => $taxonomyName['tl_name'],
  253.                     ];
  254.                     echo implode(';'$csvArray[$resultProduct['id_product']])."\r\n";
  255.                 }
  256.             } catch (Exception $e) {
  257.                 echo $e->getCode().' - '.$e->getMessage();
  258.             }
  259.         }
  260.         exit;
  261.     }
  262.     /**
  263.      * @deprecated moved to new architecture
  264.      *
  265.      * @throws \Twig\Error\SyntaxError
  266.      * @throws \Psr\Cache\InvalidArgumentException
  267.      * @throws \Twig\Error\RuntimeError
  268.      * @throws \Twig\Error\LoaderError
  269.      */
  270.     public function bigStocks()
  271.     {
  272.         if (!Tools::getSfParameter('is_staging')) {
  273.             \Sentry\captureException(new \Exception('Using legacy category controller'));
  274.         }
  275.         $languageId = (int)Session::get('id_lang');
  276.         $language = \Session::get('lang');
  277.         $isoCode = \Language::getIsoById($languageId);
  278.         $this->_object->meta_title[Session::get('id_lang')] = $this->l('Comprar a Precio de Mayorista BigStocks''categoryController');
  279.         $this->_object->meta_description[Session::get('id_lang')] = str_replace('%s'''$this->l('Comprar a precio de mayorista BigStocks. Venta al mayor B2B. Bigbuy es tu Proveedor Dropshipping de BigStocks.''categoryController'));
  280.         $this->_object->meta_keywords[Session::get('id_lang')] = $this->l('Mayorista BigStocks, dropshipping BigStocks''categoryController');
  281.         $description $this->translator->trans('big-stocks.title', [], 'messages'$language).
  282.             $this->translator->trans('big-stocks.list-header', [], 'messages'$language).'<ul><li>'.
  283.             $this->translator->trans('big-stocks.list-item-1', [], 'messages'$language).'</li><li>'.
  284.             $this->translator->trans('big-stocks.list-item-2', [], 'messages'$language).'</li><li>'.
  285.             $this->translator->trans('big-stocks.list-item-3', [], 'messages'$language).'</li><li>'.
  286.             $this->translator->trans('big-stocks.list-item-4', [], 'messages'$language).'</li><li>'.
  287.             $this->translator->trans('big-stocks.list-item-5', [], 'messages'$language).'</li><ul>';
  288.         $this->_object->meta_title[Session::get('id_lang')] = $this->l('Comprar a Precio de Mayorista BigStocks''categoryController');
  289.         $this->_object->meta_description[Session::get('id_lang')] = $description;
  290.         $this->_object->meta_keywords[Session::get('id_lang')] = $this->l('Mayorista BigStocks, dropshipping BigStocks''categoryController');
  291.         $numReferences 0;
  292.         $allTaxonomiesForLanguageId $this->taxonomyService->getAllCachedTaxonomiesForLanguage($languageId);
  293.         $taxonomyTree $this->taxonomyTreeService->getLegacyTree($allTaxonomiesForLanguageId$language, []);
  294.         $breadCrumb = [];
  295.         $sections $breadCrumb;
  296.         $taxonomyChildren = [];
  297.         $hasChildren = !empty($taxonomyChildren);
  298.         $parentTaxonomyName null;
  299.         $homeCategory App\Entity\System\Category::HOME_ID;
  300.         $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_BIG_STOCKS);
  301.         $hrefLink =  Link::getCategoryLink($this->_object->id);
  302.         $method 'category/ajax_show_bigstocks_products';
  303.         $paginatorData $this->viewService->getPaginatorDataEncoded($hrefLink$method$viewFilters$this->_object->id);
  304.         $jsParameters $this->viewService->getParameters($homeCategory0$viewFilters);
  305.         $codeJs Tools::createCategoryFilters($jsParameters);
  306.         $this->addJs($this->viewService->addJs($paginatorData$codeJs1ViewService::VIEW_TYPE_BIG_STOCKS));
  307.         $entityName $this->l('Big Stocks''categoryController');
  308.         $this->metaNoindex false;
  309.         if ($viewFilters->getAjax()) {
  310.             $this->setDisplayFooter(false);
  311.             $this->setDisplayHeadAndHeader(false);
  312.             $this->setJsonArgs($this->viewService->setJsonArguments($viewFilters));
  313.             $this->setJsonResponse(true);
  314.             if (empty($viewFilters->getCategoryProducts())) {
  315.                 $viewVars['_partials0'] = 'not_display';
  316.             } else {
  317.                 $viewVars['_partials0'] = $viewFilters->getCategoryProducts();
  318.             }
  319.             $this->setView('ajax-product-list'$viewVars);
  320.         } else {
  321.             $sectionImage 'public/img/category/stock_header';
  322.             $viewVars $this->viewService->generateViewVars(
  323.                 $sections,
  324.                 $taxonomyTree,
  325.                 $entityName,
  326.                 $description,
  327.                 $homeCategory,
  328.                 $taxonomyChildren,
  329.                 $hasChildren,
  330.                 $numReferences,
  331.                 false,
  332.                 $viewFilters,
  333.                 $sectionImage,
  334.                 $parentTaxonomyName,
  335.                 false,
  336.                 false
  337.             );
  338.             $viewVars['redirect'] = BASE_URL.'category/filterMobile/bigStocks';
  339.             $viewVars['domain'] = 'messages';
  340.             $viewVars['languageIsoCode'] = $isoCode;
  341.             $viewVars['tag_data'] = [
  342.                 'blackfriday_id' => Tag::BLACK_FRIDAY_TAG_ID,
  343.                 'blackfriday_text' => Tag::TAG_BLACK_FRIDAY_TEXT,
  344.                 'hotdeals_id' => Tag::HOTDEAL_TAG_ID,
  345.                 'hotdeals_text' => Tag::TAG_HOTDEALS_TEXT,
  346.             ];
  347.             $viewVars['rendered_twig_template'] = $this->twig->render($this->viewService->getTwigName(), $viewVars);
  348.             $this->setView('taxonomyList'$viewVars);
  349.         }
  350.     }
  351.     /**
  352.      * @deprecated moved to new architecture
  353.      *
  354.      * @throws \Psr\Cache\InvalidArgumentException
  355.      * @throws \Twig\Error\LoaderError
  356.      * @throws \Twig\Error\RuntimeError
  357.      * @throws \Twig\Error\SyntaxError
  358.      */
  359.     public function new_products(): void
  360.     {
  361.         if (!Tools::getSfParameter('is_staging')) {
  362.             \Sentry\captureException(new \Exception('Using legacy category controller'));
  363.         }
  364.         $languageId = (int)Session::get('id_lang');
  365.         $language = \Session::get('lang');
  366.         $isoCode = \Language::getIsoById($languageId);
  367.         $this->_object->meta_title[Session::get('id_lang')] = $this->l('Comprar a Precio de Mayorista Novedades''categoryController');
  368.         $this->_object->meta_description[Session::get('id_lang')] = $this->l('Comprar a precio de mayorista Novedades. Venta al mayor B2B. Bigbuy es tu Proveedor Dropshipping de novedades.''categoryController');
  369.         $this->_object->meta_keywords[Session::get('id_lang')] = $this->l('Mayorista Novedades, dropshipping Novedades''categoryController');
  370.         $numReferences 0;
  371.         $allTaxonomiesForLanguageId $this->taxonomyService->getAllCachedTaxonomiesForLanguage($languageId);
  372.         $taxonomyTree $this->taxonomyTreeService->getLegacyTree($allTaxonomiesForLanguageId$language, []);
  373.         $breadCrumb = [];
  374.         $sections $breadCrumb;
  375.         $taxonomyChildren $taxonomyTree['selcat_childs'];
  376.         $hasChildren = !empty($taxonomyChildren);
  377.         $parentTaxonomyName null;
  378.         $homeCategory App\Entity\System\Category::HOME_ID;
  379.         $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_NEW_PRODUCTS);
  380.         $hrefLink =  Link::getCategoryLink($this->_object->id);
  381.         $method 'category/ajax_show_new_products';
  382.         $paginatorData $this->viewService->getPaginatorDataEncoded($hrefLink$method$viewFilters$this->_object->id);
  383.         $jsParameters $this->viewService->getParameters($homeCategory0$viewFilters);
  384.         $codeJs Tools::createCategoryFilters($jsParameters);
  385.         $this->addJs($this->viewService->addJs($paginatorData$codeJs1ViewService::VIEW_TYPE_NEW_PRODUCTS));
  386.         $this->metaNoindex false;
  387.         if ($viewFilters->getAjax()) {
  388.             $this->setDisplayFooter(false);
  389.             $this->setDisplayHeadAndHeader(false);
  390.             $this->setJsonArgs($this->viewService->setJsonArguments($viewFilters));
  391.             $this->setJsonResponse(true);
  392.             if (empty($viewFilters->getCategoryProducts())) {
  393.                 $viewVars['_partials0'] = 'not_display';
  394.             } else {
  395.                 $viewVars['_partials0'] = $viewFilters->getCategoryProducts();
  396.             }
  397.             $this->setView('ajax-product-list'$viewVars);
  398.         } else {
  399.             $entityName $this->l('Novedades''categoryController');
  400.             $descriptionEntity Tools::replaceAutomatedLinks(
  401.                 sprintf(
  402.                     $this->l('Comprar a precio de mayorista Novedades. Venta al mayor B2B. Bigbuy es tu Proveedor Dropshipping de novedades.''categoryController'),
  403.                     '<a href="##CMS_9##">',
  404.                     '</a>'
  405.                 )
  406.             );
  407.             $sectionImage 'public/img/category/header_novedades';
  408.             $viewVars $this->viewService->generateViewVars(
  409.                 $sections,
  410.                 $taxonomyTree,
  411.                 $entityName,
  412.                 $descriptionEntity,
  413.                 $homeCategory,
  414.                 $taxonomyChildren,
  415.                 $hasChildren,
  416.                 $numReferences,
  417.                 false,
  418.                 $viewFilters,
  419.                 $sectionImage,
  420.                 $parentTaxonomyName
  421.             );
  422.             $viewVars['redirect'] = BASE_URL.'category/filterMobile/news';
  423.             $viewVars['domain'] = 'messages';
  424.             $viewVars['languageIsoCode'] = $isoCode;
  425.             $viewVars['tag_data'] = [
  426.                 'blackfriday_id' => Tag::BLACK_FRIDAY_TAG_ID,
  427.                 'blackfriday_text' => Tag::TAG_BLACK_FRIDAY_TEXT,
  428.                 'hotdeals_id' => Tag::HOTDEAL_TAG_ID,
  429.                 'hotdeals_text' => Tag::TAG_HOTDEALS_TEXT,
  430.             ];
  431.             $viewVars['rendered_twig_template'] = $this->twig->render($this->viewService->getTwigName(), $viewVars);
  432.             $this->setView('taxonomyList'$viewVars);
  433.         }
  434.     }
  435.     /**
  436.      * @deprecated moved to new architecture
  437.      *
  438.      * @throws \Psr\Cache\InvalidArgumentException
  439.      * @throws \Twig\Error\LoaderError
  440.      * @throws \Twig\Error\RuntimeError
  441.      * @throws \Twig\Error\SyntaxError
  442.      */
  443.     public function new_stock(): void
  444.     {
  445.         if (!Tools::getSfParameter('is_staging')) {
  446.             \Sentry\captureException(new \Exception('Using legacy category controller'));
  447.         }
  448.         $languageId = (int)Session::get('id_lang');
  449.         $language = \Session::get('lang');
  450.         $isoCode = \Language::getIsoById($languageId);
  451.         $this->_object->meta_title[Session::get('id_lang')] = $this->l('Comprar a Precio de Mayorista productos de nuevo en stock''categoryController');
  452.         $this->_object->meta_description[Session::get('id_lang')] = $this->l('Comprar a precio de mayorista productos de nuevo en stock. Venta al mayor B2B. Bigbuy es tu Proveedor Dropshipping de productos de nuevo en stock.''categoryController');
  453.         $this->_object->meta_keywords[Session::get('id_lang')] = $this->l('Mayorista de productos de nuevo en stock, dropshipping de productos de nuevo en stock''categoryController');
  454.         $numReferences 0;
  455.         $allTaxonomiesForLanguageId $this->taxonomyService->getAllCachedTaxonomiesForLanguage($languageId);
  456.         $taxonomyTree $this->taxonomyTreeService->getLegacyTree($allTaxonomiesForLanguageId$language, []);
  457.         $breadCrumb = [];
  458.         $sections $breadCrumb;
  459.         $taxonomyChildren $taxonomyTree['selcat_childs'];
  460.         $hasChildren = !empty($taxonomyChildren);
  461.         $parentTaxonomyName null;
  462.         $homeCategory App\Entity\System\Category::HOME_ID;
  463.         $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_NEW_STOCK_PRODUCTS);
  464.         $hrefLink =  Link::getCategoryLink($this->_object->id);
  465.         $method 'category/ajax_show_new_stock';
  466.         $paginatorData $this->viewService->getPaginatorDataEncoded($hrefLink$method$viewFilters$this->_object->id);
  467.         $jsParameters $this->viewService->getParameters($homeCategory0$viewFilters);
  468.         $codeJs Tools::createCategoryFilters($jsParameters);
  469.         $this->addJs($this->viewService->addJs($paginatorData$codeJs1ViewService::VIEW_TYPE_NEW_STOCK_PRODUCTS));
  470.         $this->metaNoindex false;
  471.         if ($viewFilters->getAjax()) {
  472.             $this->setDisplayFooter(false);
  473.             $this->setDisplayHeadAndHeader(false);
  474.             $this->setJsonArgs($this->viewService->setJsonArguments($viewFilters));
  475.             $this->setJsonResponse(true);
  476.             if (empty($viewFilters->getCategoryProducts())) {
  477.                 $viewVars['_partials0'] = 'not_display';
  478.             } else {
  479.                 $viewVars['_partials0'] = $viewFilters->getCategoryProducts();
  480.             }
  481.             $this->setView('ajax-product-list'$viewVars);
  482.         } else {
  483.             $entityName $this->l('Nuevo en stock''categoryController');
  484.             $descriptionEntity $this->_object->meta_description[Session::get('id_lang')];
  485.             $sectionImage 'public/img/category/stock_header';
  486.             $viewVars $this->viewService->generateViewVars(
  487.                 $sections,
  488.                 $taxonomyTree,
  489.                 $entityName,
  490.                 $descriptionEntity,
  491.                 $homeCategory,
  492.                 $taxonomyChildren,
  493.                 $hasChildren,
  494.                 $numReferences,
  495.                 false,
  496.                 $viewFilters,
  497.                 $sectionImage,
  498.                 $parentTaxonomyName
  499.             );
  500.             $viewVars['redirect'] = BASE_URL.'category/filterMobile/new_stock';
  501.             $viewVars['domain'] = 'messages';
  502.             $viewVars['languageIsoCode'] = $isoCode;
  503.             $viewVars['tag_data'] = [
  504.                 'blackfriday_id' => Tag::BLACK_FRIDAY_TAG_ID,
  505.                 'blackfriday_text' => Tag::TAG_BLACK_FRIDAY_TEXT,
  506.                 'hotdeals_id' => Tag::HOTDEAL_TAG_ID,
  507.                 'hotdeals_text' => Tag::TAG_HOTDEALS_TEXT,
  508.             ];
  509.             $viewVars['rendered_twig_template'] = $this->twig->render($this->viewService->getTwigName(), $viewVars);
  510.             $this->setView('taxonomyList'$viewVars);
  511.         }
  512.     }
  513.     /**
  514.      * @deprecated moved to new architecture
  515.      */
  516.     public function best_sellers(): void
  517.     {
  518.         if (!Tools::getSfParameter('is_staging')) {
  519.             \Sentry\captureException(new \Exception('Using legacy category controller'));
  520.         }
  521.         $languageId = (int)Session::get('id_lang');
  522.         $language = \Session::get('lang');
  523.         $isoCode = \Language::getIsoById($languageId);
  524.         $numReferences 0;
  525.         $allTaxonomiesForLanguageId $this->taxonomyService->getAllCachedTaxonomiesForLanguage($languageId);
  526.         $taxonomyTree $this->taxonomyTreeService->getLegacyTree($allTaxonomiesForLanguageId$language, []);
  527.         $breadCrumb = [];
  528.         $sections $breadCrumb;
  529.         $taxonomyChildren $taxonomyTree['selcat_childs'];
  530.         $hasChildren = !empty($taxonomyChildren);
  531.         $parentTaxonomyName null;
  532.         $homeCategory App\Entity\System\Category::HOME_ID;
  533.         $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->modelViewService::VIEW_TYPE_BEST_SELLERS);
  534.         $hrefLink =  Link::getCategoryLink($this->_object->id);
  535.         $method 'category/ajax_show_best_seller_products';
  536.         $paginatorData $this->viewService->getPaginatorDataEncoded($hrefLink$method$viewFilters$this->_object->id);
  537.         $jsParameters $this->viewService->getParameters($homeCategory0$viewFilters);
  538.         $codeJs Tools::createCategoryFilters($jsParameters);
  539.         $this->addJs($this->viewService->addJs($paginatorData$codeJs1ViewService::VIEW_JS_TYPE_BEST_SELLERS));
  540.         $this->metaNoindex false;
  541.         if ($viewFilters->getAjax()) {
  542.             $this->setDisplayFooter(false);
  543.             $this->setDisplayHeadAndHeader(false);
  544.             $this->setJsonArgs($this->viewService->setJsonArguments($viewFilters));
  545.             $this->setJsonResponse(true);
  546.             if (empty($viewFilters->getCategoryProducts())) {
  547.                 $viewVars['_partials0'] = 'not_display';
  548.             } else {
  549.                 $viewVars['_partials0'] = $viewFilters->getCategoryProducts();
  550.             }
  551.             $this->setView('ajax-product-list'$viewVars);
  552.         } else {
  553.             $entityName $this->l('Top Ventas''categoryController');
  554.             $descriptionEntity $this->l('¡Descubre los Top Ventas de BigBuy! Amplía el catálogo de tu comercio dropshipping con los artículos más vendidos de nuestra página web. Infórmate sobre nuestros packs mayoristas y vende al por mayor nuestros exclusivos productos.''categoryController');
  555.             $descriptionCategoryExtra $this->l('En la sección Top Ventas de BigBuy encontrarás una amplia selección de los artículos más demandados por nuestros clientes. Si todavía no eres distribuidor de BigBuy, infórmate en nuestra web sobre los requisitos y ventajas que ofrecemos a nuestros clientes y consigue ya tu tienda dropshipping.¡Compra al por mayor nuestros artículos Top Ventas y tendrás el éxito de ventas asegurado! Ofrecemos los mejores precios mayoristas del mercado europeo. Además, podrás vender sin acumular stock gracias a nuestra modalidad de venta dropshipping. ¿Quieres formar parte de un negocio exitoso en continua expansión? BigBuy te lo pone fácil, no pierdas la oportunidad de adentrarte en el mundo del e-commerce de la mano de BigBuy, experimentado mayorista y dropshipper en el mercado europeo. ¡Descubre los mejores Top Ventas navegando por esta sección de BigBuy y haz ya tu pedido al por mayor con los productos de más éxito en el mercado!''categoryController');
  556.             $sectionImage 'public/img/category/header_topventas';
  557.             $viewVars $this->viewService->generateViewVars(
  558.                 $sections,
  559.                 $taxonomyTree,
  560.                 $entityName,
  561.                 $descriptionEntity,
  562.                 $homeCategory,
  563.                 $taxonomyChildren,
  564.                 $hasChildren,
  565.                 $numReferences,
  566.                 false,
  567.                 $viewFilters,
  568.                 $sectionImage,
  569.                 $parentTaxonomyName,
  570.                 false,
  571.                 true,
  572.                 $descriptionCategoryExtra
  573.             );
  574.             $viewVars['redirect'] = BASE_URL.'category/filterMobile/best_sellers';
  575.             $viewVars['domain'] = 'messages';
  576.             $viewVars['languageIsoCode'] = $isoCode;
  577.             $viewVars['tag_data'] = [
  578.                 'blackfriday_id' => Tag::BLACK_FRIDAY_TAG_ID,
  579.                 'blackfriday_text' => Tag::TAG_BLACK_FRIDAY_TEXT,
  580.                 'hotdeals_id' => Tag::HOTDEAL_TAG_ID,
  581.                 'hotdeals_text' => Tag::TAG_HOTDEALS_TEXT,
  582.             ];
  583.             $viewVars['rendered_twig_template'] = $this->twig->render($this->viewService->getTwigName(), $viewVars);
  584.             $this->setView('taxonomyList'$viewVars);
  585.         }
  586.     }
  587.     /**
  588.      * @deprecated moved to new architecture
  589.      */
  590.     public function filterMobile($id): void
  591.     {
  592.         $languageId = (int)Session::get('id_lang');
  593.         $isoCode = \Language::getIsoById($languageId);
  594.         $viewFilters $this->viewService->getFiltersByElasticSearchResults(null$this->model$id);
  595.         $pagesExceptions = [
  596.             'news' => [
  597.                 'call' => '',
  598.                 'method' => 'category/new_products',
  599.                 'target_path' => 'category/ajax_show_new_products',
  600.                 'limit' => 0,
  601.                 'filter' => ['order' => [6]],
  602.                 'excludes' => true,
  603.             ],
  604.             'bigstocks' => [
  605.                 'call' => '',
  606.                 'method' => 'category/bigstocks',
  607.                 'target_path' => 'category/ajax_show_bigstocks_products',
  608.                 'limit' => 0,
  609.                 'filter' => ['order' => [6]],
  610.                 'excludes' => true,
  611.             ],
  612.             'new_stock' => [
  613.                 'call' => '',
  614.                 'method' => 'category/new_stock',
  615.                 'target_path' => 'category/ajax_show_new_stock',
  616.                 'limit' => 'configuration',
  617.                 'filter' => ['order' => [6]],
  618.                 'excludes' => false,
  619.             ],
  620.             'best_sellers' => [
  621.                 'call' => 'get_best_sellers',
  622.                 'method' => 'category/best_sellers',
  623.                 'target_path' => 'category/ajax_show_best_seller_products',
  624.                 'limit' => 'configuration',
  625.                 'filter' => ['order' => [6]],
  626.                 'excludes' => false,
  627.             ],
  628.             'manufacturer' => [
  629.                 'call' => 'show_products_manufacturer',
  630.                 'method' => '',
  631.                 'target_path' => 'manufacturer/ajax_show_products',
  632.                 'limit' => 'configuration',
  633.                 'filter' => ['order' => [6]],
  634.                 'excludes' => false,
  635.             ],
  636.             'tag' => [
  637.                 'call' => 'show_products_tag',
  638.                 'method' => '',
  639.                 'target_path' => 'tag/ajax_show_tagProducts',
  640.                 'limit' => 'configuration',
  641.                 'filter' => ['order' => [6]],
  642.                 'excludes' => false,
  643.             ],
  644.             'search' => [
  645.                 'call' => 'show_products_tag',
  646.                 'method' => '',
  647.                 'target_path' => 'search/result_new',
  648.                 'limit' => 'configuration',
  649.                 'filter' => [],
  650.                 'excludes' => false,
  651.             ],
  652.         ];
  653.         if (!\array_key_exists($id$pagesExceptions)) {
  654.             $this->setView('not-found');
  655.             return;
  656.         }
  657.         $page $pagesExceptions[$id];
  658.         $coreUrl Core_url_rewrite::getUrlRewriteByTargetPath($page['method'], Session::get('id_lang'));
  659.         $linkRewrite $coreUrl[0]['request_path'];
  660.         $href BASE_URL.$page['target_path'];
  661.         $jsParameters $this->viewService->getParametersToFilterMobile($id$viewFilters$linkRewrite$href);
  662.         $codeJs Tools::createCategoryFilters($jsParameters);
  663.         $this->addJs($this->viewService->addFilterMobileJs($codeJs));
  664.         $viewVars $this->viewService->generateVarsMobileFilter($viewFilters);
  665.         $this->headerClass 'fullContent';
  666.         $viewVars['redirect'] = $linkRewrite;
  667.         $viewVars['domain'] = 'messages';
  668.         $viewVars['languageIsoCode'] = $isoCode;
  669.         $viewVars['rendered_twig_template'] = $this->twig->render('front/shop_b2b/mobile/filter_mobile.html.twig'$viewVars);
  670.         $this->setView('filterMobile'$viewVars);
  671.     }
  672.     /**
  673.      * @deprecated moved to new architecture
  674.      */
  675.     public function ajax_show_bigstocks_products(): void
  676.     {
  677.         $init Tools::getValue('init');
  678.         $limit Tools::getValue('limit');
  679.         $filters Tools::getValue('filters', []);
  680.         $type Tools::getValue('type');
  681.         $isMobile Tools::getValue('mobile');
  682.         Session::set('filters'$filters);
  683.         $filters['bigStocks'] = 1;
  684.         $filters['excludeCategory'] = [ViewService::EROTIC_SEX_CATEGORY_ID];
  685.         $results Tools::getResultsElasticSearch(
  686.             Session::get('lang'),
  687.             $init,
  688.             $limit,
  689.             $this->ajax,
  690.             $filters,
  691.             Session::get('is_wholesaler')
  692.         );
  693.         $numberProducts $results['total_results'];
  694.         $resultProds $results['result'];
  695.         if ($numberProducts === false) {
  696.             $numberProducts 0;
  697.         }
  698.         $nextInit $init $limit;
  699.         $nextCallNum $limit;
  700.         if ($numberProducts $nextInit $limit) {
  701.             $nextCallNum $numberProducts $nextInit;
  702.         }
  703.         $show true;
  704.         if ($numberProducts <= $nextInit) {
  705.             $show false;
  706.         }
  707.         $this->setDisplayFooter(false);
  708.         $this->setDisplayHeadAndHeader(false);
  709.         $numProductsPaginator = ($numberProducts tools::MAX_LIST_PRODUCTS) ? tools::MAX_LIST_PRODUCTS $numberProducts;
  710.         if ($isMobile) {
  711.             $this->setJsonArgs(['num_products' => $numberProducts]);
  712.             $this->setJsonResponse(true);
  713.         } else {
  714.             $this->setJsonArgs([
  715.                 'init' => $nextInit,
  716.                 'show' => $show,
  717.                 'next_call_num' => $nextCallNum,
  718.                 'num_products' => $numberProducts,
  719.                 'num_products_paginator' => $numProductsPaginator,
  720.                 'ga_productlist' => [],
  721.             ]);
  722.             $this->setJsonResponse(true);
  723.             if (empty($resultProds)) {
  724.                 $resultProds 'not_display';
  725.             }
  726.             if ($type === 0) {
  727.                 $vars = [
  728.                     '_partials0' => $resultProds,
  729.                 ];
  730.                 $this->setView('ajax-product-list'$vars);
  731.             } else {
  732.                 $vars = [
  733.                     '_layout0' => [
  734.                         '_partials0' => $resultProds,
  735.                     ],
  736.                 ];
  737.                 $this->setView('ajax-product-list-sliders'$vars'ajax-product-list-full');
  738.             }
  739.         }
  740.     }
  741.     /**
  742.      * @deprecated moved to new architecture
  743.      */
  744.     public function ajax_show_new_products(): void
  745.     {
  746.         $init Tools::getValue('init');
  747.         $limit Tools::getValue('limit');
  748.         $filters Tools::getValue('filters', []);
  749.         $type Tools::getValue('type');
  750.         $isMobile Tools::getValue('mobile');
  751.         Session::set('filters'$filters);
  752.         $filters['dateAddFrom'] = \strtotime('-14 days');
  753.         $sexAndSensualityTaxonomyId 17088;
  754.         $eroticClothesTaxonomyId 16630;
  755.         $filters['excludeTaxonomy'] = [$sexAndSensualityTaxonomyId$eroticClothesTaxonomyId];
  756.         $results Tools::getResultsElasticSearch(
  757.             Session::get('lang'),
  758.             $init,
  759.             $limit,
  760.             $this->ajax,
  761.             $filters,
  762.             Session::get('is_wholesaler')
  763.         );
  764.         $numberProducts $results['total_results'];
  765.         $resultProds $results['result'];
  766.         if ($numberProducts === false) {
  767.             $numberProducts 0;
  768.         }
  769.         $nextInit $init $limit;
  770.         $nextCallNum $limit;
  771.         if ($numberProducts $nextInit $limit) {
  772.             $nextCallNum $numberProducts $nextInit;
  773.         }
  774.         $show true;
  775.         if ($numberProducts <= $nextInit) {
  776.             $show false;
  777.         }
  778.         $this->setDisplayFooter(false);
  779.         $this->setDisplayHeadAndHeader(false);
  780.         $numProductsPaginator = ($numberProducts tools::MAX_LIST_PRODUCTS) ? tools::MAX_LIST_PRODUCTS $numberProducts;
  781.         if ($isMobile) {
  782.             $this->setJsonArgs(['num_products' => $numberProducts]);
  783.             $this->setJsonResponse(true);
  784.         } else {
  785.             $this->setJsonArgs([
  786.                 'init' => $nextInit,
  787.                 'show' => $show,
  788.                 'next_call_num' => $nextCallNum,
  789.                 'num_products' => $numberProducts,
  790.                 'num_products_paginator' => $numProductsPaginator,
  791.                 'ga_productlist' => [],
  792.             ]);
  793.             $this->setJsonResponse(true);
  794.             if (empty($resultProds)) {
  795.                 $resultProds 'not_display';
  796.             }
  797.             if ($type === 0) {
  798.                 $vars = [
  799.                     '_partials0' => $resultProds,
  800.                 ];
  801.                 $this->setView('ajax-product-list'$vars);
  802.             } else {
  803.                 $vars = [
  804.                     '_layout0' => [
  805.                         '_partials0' => $resultProds,
  806.                     ],
  807.                 ];
  808.                 $this->setView('ajax-product-list-sliders'$vars'ajax-product-list-full');
  809.             }
  810.         }
  811.     }
  812.     /**
  813.      * @deprecated moved to new architecture
  814.      */
  815.     public function ajax_show_new_stock(): void
  816.     {
  817.         $init Tools::getValue('init');
  818.         $limit Tools::getValue('limit');
  819.         $filters Tools::getValue('filters', []);
  820.         $type Tools::getValue('type');
  821.         $isMobile Tools::getValue('mobile');
  822.         Session::set('filters'$filters);
  823.         $date = new \DateTime('-10 days');
  824.         $filters['dateBackInStock'] = $date->getTimestamp();
  825.         $results Tools::getResultsElasticSearch(
  826.             Session::get('lang'),
  827.             $init,
  828.             $limit,
  829.             $this->ajax,
  830.             $filters,
  831.             Session::get('is_wholesaler')
  832.         );
  833.         $numberProducts = isset($results['total_results']) ? $results['total_results'] : 0;
  834.         $resultProds = isset($results['result']) ? $results['result'] : false;
  835.         if ($numberProducts === false) {
  836.             $numberProducts 0;
  837.         }
  838.         $nextInit $init $limit;
  839.         $nextCallNum $limit;
  840.         if ($numberProducts $nextInit $limit) {
  841.             $nextCallNum $numberProducts $nextInit;
  842.         }
  843.         $show true;
  844.         if ($numberProducts <= $nextInit) {
  845.             $show false;
  846.         }
  847.         $this->setDisplayFooter(false);
  848.         $this->setDisplayHeadAndHeader(false);
  849.         $numProductsPaginator = ($numberProducts tools::MAX_LIST_PRODUCTS) ? tools::MAX_LIST_PRODUCTS $numberProducts;
  850.         if ($isMobile) {
  851.             $this->setJsonArgs(['num_products' => $numberProducts]);
  852.             $this->setJsonResponse(true);
  853.         } else {
  854.             $this->setJsonArgs([
  855.                 'init' => $nextInit,
  856.                 'show' => $show,
  857.                 'next_call_num' => $nextCallNum,
  858.                 'num_products' => $numberProducts,
  859.                 'num_products_paginator' => $numProductsPaginator,
  860.                 'ga_productlist' => [],
  861.             ]);
  862.             $this->setJsonResponse(true);
  863.             if (empty($resultProds)) {
  864.                 $resultProds 'not_display';
  865.             }
  866.             if ($type === 0) {
  867.                 $vars = [
  868.                     '_partials0' => $resultProds,
  869.                 ];
  870.                 $this->setView('ajax-product-list'$vars);
  871.             } else {
  872.                 $vars = [
  873.                     '_layout0' => [
  874.                         '_partials0' => $resultProds,
  875.                     ],
  876.                 ];
  877.                 $this->setView('ajax-product-list-sliders'$vars'ajax-product-list-full');
  878.             }
  879.         }
  880.     }
  881.     /**
  882.      * @deprecated moved to new architecture
  883.      */
  884.     public function ajax_show_best_seller_products(): void
  885.     {
  886.         $init Tools::getValue('init');
  887.         $limit Tools::getValue('limit');
  888.         $filters Tools::getValue('filters', []);
  889.         $type Tools::getValue('type');
  890.         $isMobile Tools::getValue('mobile');
  891.         Session::set('filters'$filters);
  892.         $filters['minRecentSales'] = 20;
  893.         $results Tools::getResultsElasticSearch(
  894.             Session::get('lang'),
  895.             $init,
  896.             $limit,
  897.             $this->ajax,
  898.             $filters,
  899.             Session::get('is_wholesaler')
  900.         );
  901.         $numberProducts $results['total_results'];
  902.         $resultProds $results['result'];
  903.         if ($numberProducts === false) {
  904.             $numberProducts 0;
  905.         }
  906.         $nextInit $init $limit;
  907.         $nextCallNum $limit;
  908.         if ($numberProducts $nextInit $limit) {
  909.             $nextCallNum $numberProducts $nextInit;
  910.         }
  911.         $show true;
  912.         if ($numberProducts <= $nextInit) {
  913.             $show false;
  914.         }
  915.         $this->setDisplayFooter(false);
  916.         $this->setDisplayHeadAndHeader(false);
  917.         $numProductsPaginator = ($numberProducts tools::MAX_LIST_PRODUCTS) ? tools::MAX_LIST_PRODUCTS $numberProducts;
  918.         if ($isMobile) {
  919.             $this->setJsonArgs(['num_products' => $numberProducts]);
  920.             $this->setJsonResponse(true);
  921.         } else {
  922.             $this->setJsonArgs([
  923.                 'init' => $nextInit,
  924.                 'show' => $show,
  925.                 'next_call_num' => $nextCallNum,
  926.                 'num_products' => $numberProducts,
  927.                 'num_products_paginator' => $numProductsPaginator,
  928.                 'ga_productlist' => [],
  929.             ]);
  930.             $this->setJsonResponse(true);
  931.             if (empty($resultProds)) {
  932.                 $resultProds 'not_display';
  933.             }
  934.             if ($type === 0) {
  935.                 $vars = [
  936.                     '_partials0' => $resultProds,
  937.                 ];
  938.                 $this->setView('ajax-product-list'$vars);
  939.             } else {
  940.                 $vars = [
  941.                     '_layout0' => [
  942.                         '_partials0' => $resultProds,
  943.                     ],
  944.                 ];
  945.                 $this->setView('ajax-product-list-sliders'$vars'ajax-product-list-full');
  946.             }
  947.         }
  948.     }
  949.     public function remove_filters()
  950.     {
  951.         Tools::remove_filters();
  952.     }
  953.     public function deleteSessionFilters()
  954.     {
  955.         Session::set('filters'false);
  956.     }
  957.     public function popupConfirmCsvListDownload()
  958.     {
  959.         $this->setDisplay_only_view(true);
  960.         $args = [
  961.             'title' => $this->l('Descarga de CSV de productos''categoryController'),
  962.             'msg' => $this->l('Para asegurar un buen rendimiento, el CSV que vas a descargar mostrará un máximo de 1.000 referencias. Te recomendamos ajustar el filtro para reducir el total de referencias.''categoryController'),
  963.             'icon' => 'draw_warning',
  964.             'actions' => [
  965.                 [
  966.                     'action' => 'submitAction',
  967.                     'text' => $this->l('Descargar CSV''categoryController'),
  968.                     'type' => 'button',
  969.                     'icon' => '',
  970.                 ],
  971.                 [
  972.                     'action' => 'close',
  973.                     'text' => $this->l('Volver''categoryController'),
  974.                     'icon' => 'fa-chevron-left',
  975.                     'type' => '',
  976.                 ],
  977.             ],
  978.         ];
  979.         $this->setView('popupOrderRepeat'$args);
  980.     }
  981. }