Post by kyprios1 » Tue Sep 13, 2011 1:07 pm

I was wondering how is the display order of the carousel determined?
For the life of me, I cannot seem to get it down.

At fist look it seemed to go by reverse last updated but I then I found it's not.

Can you point me to the right direction? I need to have them in specific order.

New member

Posts

Joined
Mon Jan 31, 2011 9:56 am

Post by sekmo » Thu Sep 29, 2011 1:01 am

Have you solved it?
I'm still facing it in 1.5.1.2.. The only thing I got is that when you just click on modify and save without making actual changes, the order changes with no reason, and looks like a random order change! ??? ??? ??? ???

User avatar
Newbie

Posts

Joined
Mon Sep 26, 2011 9:50 pm

Post by kyprios1 » Fri Sep 30, 2011 9:18 pm

I found out how it works by observation for when showing 2 out of 3 images total, hopefully you can take my findings as a base and expand it to match your case.

It goes like this: [ C , A ] B
A: oldest, C: newest

New member

Posts

Joined
Mon Jan 31, 2011 9:56 am

Post by dimko » Thu Oct 27, 2011 12:21 am

Still no one figured it out how to sort the manufacturers in carousel mod?

Using OpenCart v1.5.1.3


Active Member

Posts

Joined
Sun Sep 25, 2011 2:10 am

Post by spires » Sun Nov 13, 2011 5:07 am

Here is an easy fix to sort the banners alphabetically or numerically.

This mod will sort the banners alphabetically by title. If you add a sort number to the beginning of each title, such as (01) Item One, (02) Item Two, (03) Item Three, ...., (10) Item Ten, (11) Item Eleven, they stay in order. Remember to include leading zeros if you go above 9 items so that 1 & 10 (11, 12, 13...) , 2 & 20 (21, 22, 23...) don't group.

At the end of the query string in model/design/banner, Find:

Code: Select all

 . "'"); 
Change to:

Code: Select all

 . "' ORDER BY bid.title ASC");
Note: all banners will now sort alphabetically by title with this mod. Additionally, any prefix given to the title will be shown in the ALT tag of the image.

The correct better solution to your problem would be to add an "ORDER" column to the DB_BANNER_IMAGE_DESCRIPTION table and mod the query to sort by bid.order rather than bid.title. You could go one step further and mod the admin/controller files to allow management of the ORDER in the banner design page.

Newbie

Posts

Joined
Tue Oct 25, 2011 8:57 pm

Post by amelie » Tue Mar 20, 2012 6:50 am

spires: works like a charm! thanks :-)

How would you modify the above code to order alphabetically regardless of case? For instance, in the carousel in the following site: <http://ereadersupplystore.com/>, iPad appears last, since the 'i' is lowercase. I'd prefer to keep the 'i' lowercase, since most people are used to seeing it that way for Apple products.

Active Member

Posts

Joined
Sat Feb 05, 2011 4:15 am

Post by rph » Tue Mar 20, 2012 7:02 am

Banners Plus will also let you set the order.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by rakoom2002 » Fri Mar 22, 2013 8:52 am

Hey Spires, I really appreciate your fix for this problem. I unfortunately am not very good with code. I downloaded the banner.php file and searched for the string . "'"); and several results came up. Could you tell me which line or which string I need to add the . "' ORDER BY bid.title ASC"); to? Thank you.


RE:

Here is an easy fix to sort the banners alphabetically or numerically.

This mod will sort the banners alphabetically by title. If you add a sort number to the beginning of each title, such as (01) Item One, (02) Item Two, (03) Item Three, ...., (10) Item Ten, (11) Item Eleven, they stay in order. Remember to include leading zeros if you go above 9 items so that 1 & 10 (11, 12, 13...) , 2 & 20 (21, 22, 23...) don't group.

At the end of the query string in model/design/banner, Find:
CODE: SELECT ALL
. "'");

Change to:
CODE: SELECT ALL
. "' ORDER BY bid.title ASC");

Note: all banners will now sort alphabetically by title with this mod. Additionally, any prefix given to the title will be shown in the ALT tag of the image.

The correct better solution to your problem would be to add an "ORDER" column to the DB_BANNER_IMAGE_DESCRIPTION table and mod the query to sort by bid.order rather than bid.title. You could go one step further and mod the admin/controller files to allow management of the ORDER in the banner design page

New member

Posts

Joined
Fri Mar 15, 2013 1:23 pm

Post by cheroskate » Fri Feb 06, 2015 7:29 am

the "banner.php" file he means, is the "catalog/model/design/banner.php"... not the "admin/model/design/banner.php"
rakoom2002 wrote:Hey Spires, I really appreciate your fix for this problem. I unfortunately am not very good with code. I downloaded the banner.php file and searched for the string . "'"); and several results came up. Could you tell me which line or which string I need to add the . "' ORDER BY bid.title ASC"); to? Thank you.


RE:

Here is an easy fix to sort the banners alphabetically or numerically.

This mod will sort the banners alphabetically by title. If you add a sort number to the beginning of each title, such as (01) Item One, (02) Item Two, (03) Item Three, ...., (10) Item Ten, (11) Item Eleven, they stay in order. Remember to include leading zeros if you go above 9 items so that 1 & 10 (11, 12, 13...) , 2 & 20 (21, 22, 23...) don't group.

At the end of the query string in model/design/banner, Find:
CODE: SELECT ALL
. "'");

Change to:
CODE: SELECT ALL
. "' ORDER BY bid.title ASC");

Note: all banners will now sort alphabetically by title with this mod. Additionally, any prefix given to the title will be shown in the ALT tag of the image.

The correct better solution to your problem would be to add an "ORDER" column to the DB_BANNER_IMAGE_DESCRIPTION table and mod the query to sort by bid.order rather than bid.title. You could go one step further and mod the admin/controller files to allow management of the ORDER in the banner design page

Newbie

Posts

Joined
Fri Feb 06, 2015 7:25 am
Who is online

Users browsing this forum: No registered users and 5 guests