Jump to content

Ordenar Productos destacados pagina principal PS1.6


Recommended Posts

Buenas,

 

en el módulo de productos destacados de la pagina principa, me gustaría ordenar automáticamente los productos de tal manera que, el último que se introduzca, aparezca el primero en la portada. Sin tener que hacerlo manualmente.

En este hilo dan una solución que creo que es válida, pero aplicado a la la versión 1.5.

¿Algún alma caricativa me guía para cómo hacerlo en la versión 1.6?

Gracias!

 

Link to comment
Share on other sites

Tienes que sobreescribir la funcion _cacheProducts del modulo

modules/homefeatured

cambiar esta parte  

else
HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');

por esto

else
HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add', 'DESC' );
  • Like 2
Link to comment
Share on other sites

 

Tienes que sobreescribir la funcion _cacheProducts del modulo

modules/homefeatured

cambiar esta parte  

else
HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');

por esto

else
HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add', 'DESC' );

 

Y limpia la caché que sino no veras el cambio  ;)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...