Jump to content

Home Page Latest Products Listing


DarwinUK

Recommended Posts

Hello Everyone.

I found this post which I was hoping would answer my question. Dirty Butter asked six questions, and the original poster wasnt actually building a site. But anyway Ive listed them  and my answers here. What Id really like to do is have the home page latest products listed alphabetically, rather than by when they were added.

1. What CC version are you on and what skin?
A. 6.2.2 -  Skin e-Shift Magenta

2. Is your install stock or has it been edited?
A. Not sure what he was asking, but Ive added products

3. What is your store url?
A. https://elvis-online.co.uk/shop/

4. Do you use Categories/subcategories?
A. Yes

5. How many products do you want on the homepage?
A. 16

6. Are you wanting to eliminate the Featured, Latest, Sale Items, and Popular sections?
A. No

Hope you can help.

Thanks

Phillip

Link to comment
Share on other sites

Question #2 is asking: have you made any changes to CubeCart's programming (aka codebase)? If not, then it is as if it came fresh off the factory floor and your installed CubeCart can be considered in "stock condition".

In /classes/cubecart.class.php:

Find near line 97:

$query = sprintf("SELECT I.* FROM `%1\$sCubeCart_inventory` AS I JOIN `%1\$sCubeCart_category` AS C ON C.cat_id=I.cat_id AND C.`status`=1 AND $where ORDER BY I.date_added DESC, I.product_id DESC", $GLOBALS['config']->get('config', 'dbprefix'));

Change to:

$query = sprintf("SELECT I.* FROM `%1\$sCubeCart_inventory` AS I JOIN `%1\$sCubeCart_category` AS C ON C.cat_id=I.cat_id AND C.`status`=1 AND $where ORDER BY I.name ASC, I.date_added DESC, I.product_id DESC", $GLOBALS['config']->get('config', 'dbprefix'));

Have CubeCart clear its internal cache.

This will now sort on the product's name. If two or more products have the same name, then those will be sorted by the most recent date added, and if that still gets two or more of the same, then those get sorted by which was added last.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...