The content of this article or any related information is under the Creative Commons license BY, you can republish this content freely but you must mention the author of this article: Kernel and indicate the URL of this page: https://www.exabyteinformatica.com/tienda/foro/mostrar-los-productos-nuevos-destacados-de-forma-aleatoria-t639.html
En esta guía, explicaremos como hacer que los productos nuevos destacados en Prestashop, se muestren de forma aleatoria.
En este caso, necesitamos editar el fichero:
/modules/blocknewproducts/blocknewproducts.php
Buscamos la siguiente linea:
Código: Seleccionar todo
$newProducts = Product::getNewProducts((int) $this->context->language->id, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));
Y la reemplazamos por la siguiente:
Código: Seleccionar todo
$newProducts = Product::getNewProducts((int) $this->context->language->id, 0, 100);shuffle($newProducts);array_splice($newProducts, Configuration::get('NEW_PRODUCTS_NBR') );
Guardamos los cambios y listo! Ya tendremos los productos nuevos destacados de la página home que irán cambiando en cada carga.

No te pierdas la siguiente categoría: Foros
Salta al siguiente tema: Modificar el código de la caja del footer
Quizás también te interese: