Jump to content

latest products being shown in the end


Guest on_way_to_fame

Recommended Posts

Guest on_way_to_fame

Hi,

When I add new products to my shop, they are shown in the end, when someone views the products by category. Is there any way, I can show the latest products first and the older ones later, in the category view?

Thanks

Link to comment
Share on other sites

Guest vrakas

Ok here it goes :)

Remember to always BACKUP

Find and edit under includes/content/ the viewCat.inc.php

Find around line 159

$productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbpref .............. etc etc.........ending with ...........CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']);

Then add this ." ORDER BY productid DESC" at the end of the above line before the last ;

That should do the trick for you, i know it worked for me :)

Let me know :)

I think i will make it in to a mod and submit it to the .org forum if its not there allready :D

Also added to the FAQ pinned post :(

Link to comment
Share on other sites

Guest airjer

Would work if I didn't have 1000+ products! Due to the 1 in the beginning they go to the end too :/...

Got a fix for that?!

Well.. I'm not even sure if that is the problem because it seems some categories are sorted ok and others are just completely off.... www.ajkickz.com

Link to comment
Share on other sites

Guest on_way_to_fame

Cheers Vrakas..doesnt seem to be working for me though..once again..i wanbt the latest products at the top..and the older products at the bottonm..heres what my edited piece of code looks like?

$productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE hidden!='yes' and ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId'])ORDER BY productid DESC ;

Ash

Link to comment
Share on other sites

Guest airjer

Yea it works I put it in the wrong spot... your code should look like this

	$productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY productid DESC";

Link to comment
Share on other sites

Guest vrakas

As i mentioned, it worked for me, so this means it has been tested :)

@airjer

Glad you got it working :P

@on_way_to_fame

['catId'])ORDER BY productid DESC ;

['catId'])." ORDER BY productid DESC" ;

Notice the diference? ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...