Jump to content

Products Listed Alphabetically


Guest tomcat

Recommended Posts

Guest tomcat

Hello all,

I would be grateful is someone would be able to tell me how do I get the products to list alphabetically without having to purchase a mod?

Many thanks in advance

Pete :w00t:

Link to comment
Share on other sites

This should do it:

open includes/boxes/categories.inc.php

Find at About line 35

// query database

$results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0");

$resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'");

REPLACE WITH

// query database

$results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 order by cat_name");

$resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' order by cat_name");

Link to comment
Share on other sites

Guest tomcat

Thanks for the quick reply :w00t:

Will give it a try straight away

Sorry to be a pain but...

Does this list the product listings alphabetically or does it do the category listings?

Link to comment
Share on other sites

I think it'll do both but if that doesn't work try:

Open /includes/contents/viewCat.inc.php

Find somewhere @ line 158

QUOTE

$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']);

Replace it with

QUOTE

$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 name ASC";

Link to comment
Share on other sites

Guest tomcat

Hi roban,

Don think that it is doing the products alphabetically. It is just doing the categories. Any ideas on how to do the products at all?

Many Thanks

Pete

Link to comment
Share on other sites

$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 ".$glob['dbprefix']."CubeCart_inventory.name ASC";

Link to comment
Share on other sites

Guest tomcat

Hi again,

Thanks for all this help from both of you. This doesn't seem to be listing the products alphabetically though :w00t:

Any last thoughts for a cure?

Many Thanks

Peter

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...