Post by shughey » Sat Jan 10, 2009 3:04 am

Is there an effective way to duplicate the pagination at the top right to the bottm right of each page?  It would prevent having to scroll all the way back to the top just to go the next page?

Also, can page 1 (of however many pages) be made the default page?  As it is now, if you are on page 3 and navigate away from that page but then return you are still on page 3.

Thanks,
Sam

New member

Posts

Joined
Mon Oct 27, 2008 12:02 am

Post by Qphoria » Sat Jan 10, 2009 3:46 am

shughey wrote: Is there an effective way to duplicate the pagination at the top right to the bottm right of each page?  It would prevent having to scroll all the way back to the top just to go the next page?
I actually discovered a bug looking into this.....

Edit: catalog/template/default/content/category.tpl
Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $pages) { ?>
        <?php if ($pages['value'] == $page) { ?>
        <option value="<?php echo $pages['value']; ?>" SELECTED><?php echo $pages['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $pages['value']; ?>"><?php echo $pages['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
Replace with:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $xpage) { ?>
        <?php if ($xpage['value'] == $page) { ?>
        <option value="<?php echo $xpage['value']; ?>" SELECTED><?php echo $xpage['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $xpage['value']; ?>"><?php echo $xpage['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
Then Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
</div>
Replace with:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $xpage) { ?>
        <?php if ($xpage['value'] == $page) { ?>
        <option value="<?php echo $xpage['value']; ?>" SELECTED><?php echo $xpage['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $xpage['value']; ?>"><?php echo $xpage['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
Also, can page 1 (of however many pages) be made the default page?  As it is now, if you are on page 3 and navigate away from that page but then return you are still on page 3.
Yea, this is one of those features that nobody cares for. You can fix it.....

EDIT: catalog/controller/category.php

FIND:

Code: Select all

$session->set(($request->has('path') ? 'category.' . $request->gethtml('path') . '.page' : 'category.page'), $request->gethtml('page', 'post'));
REPLACE WITH:
//$session->set(($request->has('path') ? 'category.' . $request->gethtml('path') . '.page' : 'category.page'), $request->gethtml('page', 'post'));
See below for proper fix
Last edited by Qphoria on Sat Jan 10, 2009 6:00 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shughey » Sat Jan 10, 2009 4:20 am

Also, can page 1 (of however many pages) be made the default page?  As it is now, if you are on page 3 and navigate away from that page but then return you are still on page 3.
Yea, this is one of those features that nobody cares for. You can fix it.....

EDIT: catalog/controller/category.php

FIND:

Code: Select all

$session->set(($request->has('path') ? 'category.' . $request->gethtml('path') . '.page' : 'category.page'), $request->gethtml('page', 'post'));
REPLACE WITH:

Code: Select all

//$session->set(($request->has('path') ? 'category.' . $request->gethtml('path') . '.page' : 'category.page'), $request->gethtml('page', 'post'));
This defaults any attempt to go to page 2, 3, 4 or whatever back to page 1 without ever going to page 2,3,4 or whatever.

New member

Posts

Joined
Mon Oct 27, 2008 12:02 am

Post by Qphoria » Sat Jan 10, 2009 5:59 am

OH yea sorry..

UNDO THAT CHANGE

The proper fix is:

FIND:

Code: Select all

$view->set('page', ($request->has('path') ? $session->get('category.' . $request->gethtml('path') . '.page') : $session->get('category.page')));
AFTER, ADD:

Code: Select all

$session->delete('category.' . $request->gethtml('path') . '.page');
Last edited by Qphoria on Sat Jan 10, 2009 6:07 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shughey » Sat Jan 10, 2009 9:00 am

Qphoria wrote: OH yea sorry..

UNDO THAT CHANGE

The proper fix is:

FIND:

Code: Select all

$view->set('page', ($request->has('path') ? $session->get('category.' . $request->gethtml('path') . '.page') : $session->get('category.page')));
AFTER, ADD:

Code: Select all

$session->delete('category.' . $request->gethtml('path') . '.page');
Excellent. Works great.

New member

Posts

Joined
Mon Oct 27, 2008 12:02 am

Post by shughey » Sat Jan 10, 2009 9:14 am

Qphoria wrote:
shughey wrote: Is there an effective way to duplicate the pagination at the top right to the bottm right of each page?  It would prevent having to scroll all the way back to the top just to go the next page?
I actually discovered a bug looking into this.....

Edit: catalog/template/default/content/category.tpl
Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $pages) { ?>
        <?php if ($pages['value'] == $page) { ?>
        <option value="<?php echo $pages['value']; ?>" SELECTED><?php echo $pages['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $pages['value']; ?>"><?php echo $pages['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
Replace with:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $xpage) { ?>
        <?php if ($xpage['value'] == $page) { ?>
        <option value="<?php echo $xpage['value']; ?>" SELECTED><?php echo $xpage['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $xpage['value']; ?>"><?php echo $xpage['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
Then Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
</div>
Replace with:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
  <div class="right"><?php echo $entry_page; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <div>
      <select name="page" onchange="this.form.submit();">
        <?php foreach ($pages as $xpage) { ?>
        <?php if ($xpage['value'] == $page) { ?>
        <option value="<?php echo $xpage['value']; ?>" SELECTED><?php echo $xpage['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $xpage['value']; ?>"><?php echo $xpage['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
      </div>
    </form>
  </div>
</div>
I'm a bit confused with something. You said to

Then Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
</div>
Isn't this part of what I already did above?  All I can find is
  (no second /div)

New member

Posts

Joined
Mon Oct 27, 2008 12:02 am

Post by Qphoria » Sat Jan 10, 2009 9:20 am

shughey wrote:
I'm a bit confused with something. You said to

Then Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
</div>
Isn't this part of what I already did above?  All I can find is
  (no second /div)
There are 2 spots... that second one is at the very bottom.

Or just use the attached version:

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shughey » Sat Jan 10, 2009 9:28 am

Qphoria wrote:
shughey wrote:
I'm a bit confused with something. You said to

Then Find:

Code: Select all

<div class="results">
  <div class="left"><?php echo $text_results; ?></div>
</div>
Isn't this part of what I already did above?  All I can find is
  (no second /div)
There are 2 spots... that second one is at the very bottom.

Or just use the attached version:
I found the problem.  It's working perfectly now.

Thanks,
Sam

New member

Posts

Joined
Mon Oct 27, 2008 12:02 am

Post by hm2k » Sat Jan 10, 2009 11:37 pm

http://code.google.com/p/open-cart/source/detail?r=327

Are there any other changes to be made? I'll probably leave them up to Qphoria.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK
Who is online

Users browsing this forum: No registered users and 33 guests