eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
Development resources
 ::   WebWare 2.1 (Perl)
 ::   WebWare 2.0 (Java)
 ::   Cool hacks
cool hacks
Next/Prev Hack v2.0  
sent in the following hack...


It's me again, and this hack is an updated version of my earlier
'Next/Prev' Button hack.  This version is the answer to all of the BBS
posts about the incorrect functionality of the 'Continue Shopping'
button on the cart pages for multiple product pages with db-based
stores.

Actually, this is the ultimate 'Next/Prev' Hack as it has all the
features of my earlier one (Next & Previous buttons, number on buttons
based on your $sc_db_max_rows_returned for easy installation, last Next
button shows the exact row count if less than $sc_db_max_rows_returned
for accuracy, & has an 'x out of xx' count whether or not Next/Prev
buttons are needed) but this time I have been able to include the one
feature that was missing: the correct behaviour for the 'Continue
Shopping' buttons on the cart pages!

That's right - now if your visitor is on a cart page and they hit the
'Continue Shopping' button, they actually go back to the EXACT product
page they left, not the first page of the search as all of the other
'Next/Prev' hacks had it.  And this is a Perl solution within WebStore,
not the JavaScript solution that can be found in the bulletin boards, so

if the visitor is using your store this hack will work regardless of
their browser's setup.

Here's the script!

That should do it for you; you can see working example of the hack at
http://www.arantrophies.com .  The site isn't finished but some of the
dbase is up and functioning (at the time of this writing, Sculptures,
Medals, and Plaques are all up).  If you have any problems you can reach

me at .  I'm more than happy to help with the
install, time constraints permitting, and I have already successfully
helped someone with a subtle error.

Good luck and I hope this helps to make your store become the store you
desire!

This version also fixes a bug where if the last product page had a
number of products equal to the amount that is shown on each page, the
'Next' button would be displayed as 'Next 0 >>'.  This has been fixed so
that the 'Next' button is not displayed at all.

Louis Plourde