ZenCart – New Products Sort Order Descending Latest

To set the descending order in zencart for new products showing latest products on the top, in descending order, here is the code you have to change, to set your latest products to display on top as New Products.

New Products Sort Order Descending

To show latest products in descending order in zencart, please open up the new_products.php file, existing in the following path:

includes/modules/new_products.php

or if you are using a zencart theme, then it should be appearing in your theme path as:

includes/modules/your_theme_folder/new_products.php

After opening the new_products.php file, add the following line of code:

$new_products_query .= ” ORDER BY products_date_added DESC
LIMIT ” . MAX_DISPLAY_NEW_PRODUCTS;

right before the following line:

if ($new_products_query != ”) $new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);

Once you’re done, save the file and check out your new products, displaying in the homepage. Now you will be able to display your latest products in descending sort order in your homepage.

If you have any comments, or you have any other solution, please post your comment and let us know.

Uncategorised

Leave a Reply

Your email address will not be published. Required fields are marked *