Post by TexasPrairieGal » Sat Oct 12, 2013 11:02 am

*Forgive if this has already been covered elsewhere. I have searched the forum but wasn't able to find an answer.

How can I change the default sort of products in my stores Admin? I understand the default sort is alphabetical, but I would like to change that to Newest first. Yes, I know that I can sort by ID, but I don't want to continually have to resort the product list every time I pull it up, or every time I finish listing a new item.

If it makes a difference, I have a multi-store setup, using OC version 1.5.5.1

I'm not real technically adept, so if it requires changing a file somewhere... what file, what line, where to find it and what to change/add would be much appreciated!! (think like a real basic kindergarten simple how-to). **crossing fingers**

Thanks in advance for any and all help!! :)

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by cwswebdesign » Sat Oct 12, 2013 11:13 am

Is the sort order option enough under catalog -->> products --> Open your product -->> click the data tab and scroll to the bottom or am I missing something else here?

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by TexasPrairieGal » Sat Oct 12, 2013 11:36 am

Hi DL... If anyone is missing something it's probably me. In my Admin I only have Catalog > Products. There's nothing to select beyond that... it just populates the Product List (which in my case is 46 pages with 100 products per page). I do have an ID column which I can use to sort to Newest first. But every time I leave the product page, the sort defaults back to alphabetical by product title... and then I have to resort again to see newest products first.

I'm not looking to sort the products as they display in my store (that's already set to display newest first). But I am hoping and crossing my fingers that there's a way to get my Admin to display a list of my products already sorted to display the most recently listed first. With over 4500 products, an alphabetical list of products is just not very helpful.

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by cwswebdesign » Sat Oct 12, 2013 2:50 pm

TexasPrairieGal wrote:Hi DL... If anyone is missing something it's probably me. In my Admin I only have Catalog > Products. There's nothing to select beyond that... it just populates the Product List (which in my case is 46 pages with 100 products per page). I do have an ID column which I can use to sort to Newest first. But every time I leave the product page, the sort defaults back to alphabetical by product title... and then I have to resort again to see newest products first.

I'm not looking to sort the products as they display in my store (that's already set to display newest first). But I am hoping and crossing my fingers that there's a way to get my Admin to display a list of my products already sorted to display the most recently listed first. With over 4500 products, an alphabetical list of products is just not very helpful.

Ahh now I see what you're trying to do. I was trying to point you in the direction to sort your products on the catalog side.

How about one of the following? I've never used any of them but I just did a quick search:

http://www.opencart.com/index.php?route ... uct%20sort

http://www.opencart.com/index.php?route ... uct%20sort

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by TexasPrairieGal » Sat Oct 12, 2013 3:29 pm

Oh DL, you're such a sweetheart for trying to help. ♥♥
Unfortunately I don't think a drag and drop will do it for me. For example, if I listed an item and the title started with a "V" (vintage), that item would be on like page 44 or page 45 when I want it to be in the number 1 spot on the first page... And even if I could drag between pages, that would be so time-consuming. And if the title started with "J" or "N" who knows what page it ended up on? (I'd first have to actually find the page the product ended up on thru the default alphabetical sort before I could even think about "relocating" it). :'(

I was sooo hoping that there was some way to just add something to the code that would tell my admin to sort the products by date added - descending (I think descending would be newest first to oldest last??). Anyways, I saw where someone in the forum came up with a way to do that for categories (which didn't make much sense to me...), but I couldn't find where anyone had come up with something to permanently change the product sort. And so far I haven't been able to find an extension, either... It just seems so weird that it can be done for the storefront... but not the Admin? (of course, I'm close to clueless about code, so what seems like it should be easy to me could actually be painfully difficult... **sigh**)

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by cwswebdesign » Sat Oct 12, 2013 11:20 pm

I don't know what to tell you other than try contacting one of the other developers directly to see if they could make this type of mod for you (maybe Q or one of the developers listed on the 2 extensions I showed you).

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by labeshops » Sat Oct 12, 2013 11:31 pm

What I think you are looking for is in admin > products you want to change the default sort order to list by product_id DESC instead of pd.name ASC which is the usual default, right? So that the last product you added is shown first (unless you use one of the filters to sort it otherwise)??

I actually tried to do this early on but never went back to try to figure it out after I understood opencart better. Should be a simple matter so I'll take a look again when I have a chance.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by TexasPrairieGal » Sun Oct 13, 2013 12:48 am

OMG, labeshops... That's EXACTLY what I want!

You don't know it, but you're my multi-store idol!! Your posts about setting things up have been soooo helpful!! I would be forever and ever grateful if you came up with a solution. :)

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by labeshops » Sun Oct 13, 2013 1:28 am

TexasPrairieGal wrote:OMG, labeshops... That's EXACTLY what I want!

You don't know it, but you're my multi-store idol!! Your posts about setting things up have been soooo helpful!! I would be forever and ever grateful if you came up with a solution. :)

Awww thanks. Now I'm blushing :)

I had done that with my old cart software and it was one of those things on my "to do" list I haven't gotten around to yet. Not sure I will for a bit - Halloween is my busiest time of year (tip: never open a costume store if you don't want to go CRAZY during Halloween :P ) so if anyone else has an idea how to do this, please post. Should be a simple sort order change but I remember trying different things when I first installed opencart and never got it right.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by TexasPrairieGal » Wed Oct 23, 2013 1:08 pm

I just thot I would let y'all know that in total frustration I finally posted a plea for assistance with this in the forum section where you ask for paid help... and I'm ecstatic!!! It's exactly the way I want it now... default sort of products in my Admin is now most recently listed first (so prod_id descending). It's awesome awesome awesome!!! **Happy Dance**

But... labeshops is STILL my multi-store idol! That will never ever change!!! :)

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by matte2k » Thu Nov 07, 2013 5:01 am

aaargh... I want to know the answer :(
Do you know what the paid help did?

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm

Post by TexasPrairieGal » Thu Nov 07, 2013 5:16 am

I have no clue what they did... Coding and I are NOT friends with each other at all... not even a tiny little bit. If I touched any of the code I would probably destroy my stores totally. But, here's his website and you could contact him thataway:
http://dolrichfortich.com/
It didn't cost very much at all... but it was worth a small fortune to me!!!
Best of luck! :)

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by matte2k » Thu Nov 07, 2013 5:22 am

Ok. thanks... how much did he charge for that?

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm

Post by TexasPrairieGal » Thu Nov 07, 2013 7:44 am

I hesitate to say what it cost me... because your situation may be different than mine and I don't want to be the cause for any conflicts or friction. But I will say it was beyond reasonable!

New member

Posts

Joined
Sun Aug 11, 2013 1:07 am

Post by khurrum » Fri Nov 15, 2013 11:28 am

In the file admin/controller/catalog/product.php

Find the following code:

Code: Select all

	if (isset($this->request->get['sort'])) {
			$sort = $this->request->get['sort'];
		} else {
			$sort = 'pd.name';
		}

		if (isset($this->request->get['order'])) {
			$order = $this->request->get['order'];
		} else {
			$order = 'ASC';
		}
Replace with following code:

Code: Select all

if (isset($this->request->get['sort'])) {
 $sort = $this->request->get['sort'];
 } else {
 $sort = 'p.date_added';
 }

 if (isset($this->request->get['order'])) {
 $order = $this->request->get['order'];
 } else {
 $order = 'DESC';
 }
In the file admin/model/catalog/product.php add the red marked code

$sort_data = array(
'pd.name',
'p.model',
'p.price',
'p.quantity',
'p.status',
'p.sort_order',
'p.date_added' //add this column name
);

Newbie

Posts

Joined
Wed Oct 23, 2013 10:36 pm

Post by matte2k » Mon Nov 18, 2013 2:58 am

Worked perfect! Thanks!!!
Do you also know how to sort

the module Latest to sort by releasedate, latest first, not the latest added like now.
the module Special to sort by random
the module Featured to sort by random
module Bestsellers to sort by random (of the top 20 bestsellers)


edit:
this thread with some vqmods did the trick..
http://forum.opencart.com/viewtopic.php ... lit=random

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm
Who is online

Users browsing this forum: No registered users and 45 guests