X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Improved Search Results Pagination (https://forum.x-cart.com/showthread.php?t=27364)

PhilJ 12-14-2006 08:59 AM

Improved Search Results Pagination
 
Better looking search result pages pagination, easy to customise, v4.0.x and v4.1.x

http://www.xcartmods.co.uk/images/nav.jpg

1) Replace...

skin1/customer/main/navigation.tpl

with...

Code:

{* Better looking navigation.tpl - www.xcartmods.co.uk *}
{assign var="navigation_script" value=$navigation_script|amp}
{if $total_pages gt 2}
<div class="navigation">
<ul>
 {if $current_super_page gt 1}
 <li><a href="{$navigation_script}&page={math equation="page-1" page=$start_page}"  title="{$lng.lbl_prev_group_pages}">&laquo;&laquo;</a></li>
 {/if}
 {section name=page loop=$total_pages start=$start_page}
 {if %page.first%}
 {if $navigation_page gt 1}
 <li><a href="{$navigation_script}&page={math equation="page-1" page=$navigation_page}" title="{$lng.lbl_prev_page}">&laquo;</a></li>
 {/if}
 {/if}
 {if %page.index% eq $navigation_page}
 <li title="{$lng.lbl_page} {%page.index%}"><a href="#" class="currentpage">{%page.index%}</a></li>
 {else}
 <li><a href="{$navigation_script}&page={%page.index%}" title="{$lng.lbl_page} {%page.index%}">{%page.index%}</a></li>
 {/if}
 {if %page.last%}
 {math equation="pages-1" pages=$total_pages assign="total_pages_minus"}
 {if $navigation_page lt $total_super_pages*$config.Appearance.max_nav_pages}
 <li><a href="{$navigation_script}&page={math equation="page+1" page=$navigation_page}" title="{$lng.lbl_next_page}">&raquo;</a></li>
 {/if}
 {/if}
 {/section}
 {if $current_super_page lt $total_super_pages}
 <li><a href="{$navigation_script}&page={math equation="page+1" page=$total_pages_minus}" title="{$lng.lbl_next_group_pages}">&raquo;&raquo;</a></li>
 {/if}
</ul>
</div>
{/if}


2) In...

skin1/skin1.css

and

skin1/skin1_admin.css

add...

Code:

/* Better looking navigation START - www.xcartmods.co.uk */
.navigation{
 padding: 5px;
}
.navigation ul {
 margin: 0;
 padding: 0;
 text-align: center;
 font-size: 1.0em;
}
.navigation li {
 list-style-type: none;
 display: inline;
 padding-bottom: 1px;
}
.navigation a, .navigation a:visited {
 padding: 4px 4px 4px 4px;
 border: 1px solid #9aafe5;
 text-decoration: none;
 color: #2e6ab1;
 font-weight: bold;
}
.navigation a:hover, .navigation a:active {
 border: 1px solid #2b66a5;
 color: #000;
 background-color: #E2E9F1;
 font-weight: bold;
 text-decoration: none;
}
.navigation a.currentpage {
 background-color: #2e6ab1;
 color: #FFF !important;
 border-color: #2b66a5;
 font-weight: bold;
 cursor: pointer;
 font-weight: bold;
 text-decoration: none;
}
.navigation a.currentpage:hover, .navigation a.currentpage:active {
 background-color: #2e6ab1;
 border-color: #9aafe5;
}
/* Better looking navigation END - www.xcartmods.co.uk */


:)

NightFire 12-14-2006 09:06 AM

Re: Improved Search Results Pagination
 
Thank you very much. Really a great improvement in layout ;-)

herseyc 12-14-2006 10:59 AM

Re: Improved Search Results Pagination
 
Very nice - Thanks

Jon 12-14-2006 12:32 PM

Re: Improved Search Results Pagination
 
But I like the unintuitive pagination buttons you can barely see to read, plus the pagination has page images, get it, pages for pagination?

Metal-X-Man 12-15-2006 06:45 PM

Re: Improved Search Results Pagination
 
PhilJ,

Once again, your mods are much appreciated! I didn't even realize I couldn't stand those standard x-cart nav links!

Metal-X-Man

Metal-X-Man 03-02-2008 04:23 PM

Re: Improved Search Results Pagination
 
Have you noticed that the wonderfully painful IE7 stretches out the active nav box on this great mod?

Anybody have a fix for this? If I fix it, I'll post something too.

Metal-X

PhilJ 03-02-2008 04:49 PM

Re: Improved Search Results Pagination
 
I've updated the code, should fix the IE7 issue, although the colours are now blue.

Metal-X-Man 03-02-2008 05:14 PM

Re: Improved Search Results Pagination
 
Perfect! It looks better than the original!

Nice work Phil and thanks!

Metal-X

fotodog13 03-20-2008 02:47 PM

Re: Improved Search Results Pagination
 
Hey Phil,
I would love to use this but I am getting an error message


Error: Smarty error: [in customer/main/navigation.tpl line 1]: syntax error: unrecognized tag: \rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf470 {\fonttbl\f0\fswiss\fcharset77 Helvetica; (Smarty_Compiler.class.php, line 436)

Do I need to do anything other than replace the navigation.tpl and add the skin1.css code- ( stupid question do I have to remove things in the skin1.css aswell?

Thanks for the help

Scott V
4.18
Apache

PhilJ 03-20-2008 02:53 PM

Re: Improved Search Results Pagination
 
Save the code as plain text, then upload it. Looks like you've used some kind of word processor there.

fotodog13 03-20-2008 04:08 PM

Re: Improved Search Results Pagination
 
Thanks Phil,

got it to work- looks great.
Once I saved as a txt it worked great. When I looked at twhat I had loaded -the errored code- it looked nothing like what it was suppose to.
Strange,

Also just a FYI - This looks sooo much better than the x cart results- WHen I did get it too work I had to go into the general settings and changet the max number of pages to displkay to 5 there - I think mine was set at 10 which might be he default which caused the line to be jumbled - I am just mentioning it for others so that if they have their pages set to display 10 pages that might be why- this way someone else doesn't aske you to fix something that aint broke!
thanks again for the help

best

Scott v

PhilJ 03-20-2008 04:23 PM

Re: Improved Search Results Pagination
 
Glad it all worked out :)

davidsaldana 10-24-2008 08:25 PM

Re: Improved Search Results Pagination
 
Excellent and much needed mod.....thank you!

davidsaldana 10-26-2008 07:48 AM

Re: Improved Search Results Pagination
 
Made a slight adjustment to this mod for version 4.1.11, that some of you might find nice. The following code will add a "show all" as the first button, which will allow customer to view all products, instead of individual pages.

Modified navigation tpl, as stated in the original post. Right after the opening <ul> place the following:
Code:

<li>{if $smarty.server.PHP_SELF ne '/manufacturers.php' && $smarty.server.PHP_SELF ne '/admin/orders.php' && $smarty.server.PHP_SELF ne '/orders.php' }
<a href="{$navigation_script}&amp;show=all">View All</a></li>
{/if}


Then open init.php and find:
Code:

#
# Read config variables from Database
# This variables are used inside php scripts, not in smarty templates
#
$c_result = db_query("SELECT name, value, category FROM $sql_tbl[config] WHERE type != 'separator'");
$config = array();
if ($c_result) {
    while ($row = db_fetch_row($c_result)) {
        if (!empty($row[2]))
            $config[$row[2]][$row[0]] = $row[1];
        else
            $config[$row[0]] = $row[1];
        }
}


Right after this line, add the following:

Code:

#
# Show All Mod By Westin Shafer for Beach Bums Inc.
#
if ($_GET['show'] == 'all'){
    $config['Appearance']['products_per_page'] = 500;
}


This code is from another mod here on the forums, but adjusted to fit into phils.

jbvideo 11-14-2008 11:36 AM

Re: Improved Search Results Pagination
 
Hello,

need a little assistance.

I followed the instructions for this mod .. but my navigation numbers are not being displayed on a horizontal line. they are being displayed vertically.

this happened before and after I added the "view all" mod

so it basically looks like a bullet list

* View All
* 1
* 2
* 3
* >>


Except they're bullets instead of asterisks.

What am I missing?

piikpuuk 11-14-2008 12:17 PM

Re: Improved Search Results Pagination
 
Quote:

Originally Posted by jbvideo
Hello,

need a little assistance.

I followed the instructions for this mod .. but my navigation numbers are not being displayed on a horizontal line. they are being displayed vertically.

this happened before and after I added the "view all" mod

so it basically looks like a bullet list

* View All
* 1
* 2
* 3
* >>


Except they're bullets instead of asterisks.

What am I missing?



Delete this line from CSS >
/* Better looking navigation END - www.xcartmods.co.uk */

Then it should work! :)

jbvideo 11-14-2008 12:36 PM

Re: Improved Search Results Pagination
 
I got it working, thank you. it was user error on my part.

I have a modified cart and didnt update all of the css files.

Thanks for your help.

flyclothing 11-20-2008 04:59 PM

Re: Improved Search Results Pagination
 
Great mod. Definitely looks better!

JWait 11-27-2008 04:46 AM

Re: Improved Search Results Pagination
 
Looks great... except is centered on the page. How do I get it align to the left? I tried "float" but it drops to the next line, just before the <hr>

PhilJ 11-27-2008 05:13 AM

Re: Improved Search Results Pagination
 
Code:

.navigation ul {
 margin: 0;
 padding: 0;
text-align: left;
 font-size: 1.0em;
}


JWait 11-27-2008 07:48 AM

Re: Improved Search Results Pagination
 
That did it, thanks!

JWait 10-04-2009 07:59 AM

Re: Improved Search Results Pagination
 
Has anyone tried this with version 4.2.x? Any success?

EDIT: to answer my own question, YES!

JWait 08-12-2011 05:59 AM

Re: Improved Search Results Pagination
 
I've also got it to work with 4.4.x. Great mod!

Freakmode 02-07-2014 04:00 AM

Re: Improved Search Results Pagination
 
A blast from the past but is it possible to get this working in 4.6
This was the best nav mod back in the day.


All times are GMT -8. The time now is 01:10 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.