Latest News: (loading..)

Archived

This topic is now archived and is closed to further replies.

tapa

Product listing problem

6 posts in this topic

I disable "Display Cart After Adding Product"

 

For example, on page 5 of 20 pages in product listing, after adding product to "basket" (Buy Now), returns me to 1 page of 20.

 

How to correct this?

Share this post


Link to post
Share on other sites

The problem is caused buy the tep_href_link function when called through tep_redirect

 

tep_href_link changes any ampersands (&) to & within the uri, which is correct for any in page links, however the tep_redirect is not a link, its a redirect and its purpose for calling tep_href_link is to ensure the sid remains hence session info is not lost, but changing & to & in a redirect is wrong as its re-writing the uri such that it now has & and will no longer be understood

 

A rough and ready fix, in includes/functions/html_output.php line 68:

$link = str_replace('&', '&', $link);

change it to:

if ($_GET['action'] != 'buy_now') $link = str_replace('&', '&', $link);

 

but there are other instances where this could cause issues, so a better fix should be sort.

Share this post


Link to post
Share on other sites

Actually , problem gone when I set "Use Search-Engine Safe URLs - True"

 

But @@spooks tip works well too!

Share this post


Link to post
Share on other sites

@@tapa

Use Search-Engine Safe URLs

 

It would do as that option removes all instances of the ampersand in the uri, however its known that use of Search-Engine Safe URL can cause other problems, so is not recommended.

Share this post


Link to post
Share on other sites

Yes , I found one problem:

in "Advanced search" when I searching by "date from" - "date to" -> problem with pagination.

Share this post


Link to post
Share on other sites