Menu

Problems with a link in show cart

Help 2.02
2003-05-13
2003-05-19
  • David Rodríguez García

    Hello Andreas.. I guess you have already resolve this problem but maybe in German...

    When I go to show cart page and then I recalculate the prize of an item, the link to come back for choosing another items doesnt work. I think the problem is that the link goes to the last page visited, not to the correct one... Where do it really have to go to? and where must I fix it?

    Thanks...

     
    • Andreas Kansok

      Andreas Kansok - 2003-05-13

      Yes you are right: A solution in German was here last days ...
      But I think, I get it together in English too ;-)

      view_cart.php
      Line97 (from search results) and 102 ((when someone comes from item selection) use 'javascript:history.go(-1)' to go back to last page. If recalculated sums as last action or delete something, this command goes back to page without changes.

      Use instead of JavaScript in 97 search.php and main.php in 102. All other values seem to be prepared.

      Greetings,
      Andreas.

      if (!isset($lookfor)) {
        echo "<form action=\"main.php\" method=\"post\">\n";
        echo "<input type=hidden name=abt value=\"$abt\">\n";
        echo "<input type=hidden name=\"itemgr\" value=\"$itemgr\">\n";
      }
      else {
        echo "<form action=\"search.php\" method=\"post\">\n";
        echo "<input type=hidden name=lookfor value=\"$lookfor\">\n";
        echo "<input type=submit value='$vc_9'></form></td>\n";
      }
      echo "<input type=hidden name=startlimit value=\"$startlimit\">\n
        <input type=hidden name=\"sess\" value=\"$sess\">\n
        <input type=submit value='$vc_9'></form></td>\n";

       
    • David Rodríguez García

      Thanks... It seems to be working now ;)

       
    • David Rodríguez García

      Upsss... Sorry Andreas... Ive found another problem...

      Now, when I come to the view cart page from a search I get two come back buttons... If I click on the first one nothing happens... In the second I get this messagge:

      Warning: Cannot send session cache limiter - headers already sent (output started at /docroot/mysql/phpayv2.02/header.inc.php:2) in /docroot/mysql/phpayv2.02/header.inc.php on line 12

      Maybe the problem is I havent understand what I have to change in main.php... I feel very stupid...

       
    • Andreas Kansok

      Andreas Kansok - 2003-05-14

      Why changing in main.php? I wrote nothing about ... only told about view_cart.php in this thread ... PHP-Code above replaces lines 96-109 in view_cart.php ...

       
    • David Rodríguez García

      Sorry... My horrible English never helps ;)

      Thats just what I have done (replacing lines 96-109 in view_cart.php with your code) but then when I try tu buy one item I can only see the 'recalculate' and 'come back' buttons, but no the 'continue' one. And if I use the search field and try to buy an item of the list, then I get the view cart with these two bottons and (again) one for 'come back'...

      Where am I wrong???...

      Thanks for your patience ;)

       
    • David Rodríguez García

      I have found the solution for the first problem. Now I can see the 'continue' button again. But it still doesnt work when I come from a search. You know... I get two buttons for comming back and select more items and (when I click on them) the message:

      Warning: Cannot send session cache limiter - headers already sent (output started at /docroot/mysql/phpayv2.02/header.inc.php:2) in /docroot/mysql/phpayv2.02/header.inc.php on line 12

       
    • Andreas Kansok

      Andreas Kansok - 2003-05-15

      Okay ... now I understand ... Remove line 103, there is the second back-button ...

       
    • David Rodríguez García

      Thanks Andreas... Youre my hero ;P... Its working

       
    • David Rodríguez García

      I dont know what I have touch... It was working perfect but now I have found another problem...

      When I try to come back from view_cart to a page with more than five items (thats the limit I choose) I only get the message "You have an error in your SQL syntax near ' 5' at line 1"...

      I cant find the file that is not working... I think maybe view_cart.php or limit_navi.inc.php because I have only modificated this files today... But I cant see the bug...

      Thanks again Andreas...

       
      • Andreas Kansok

        Andreas Kansok - 2003-05-16

        What shall I say ... If you change something, which don't work, you have to fix it yourself ;-)
        In example replace changed files with original from package ;-)

        I feel, that limit_navi* produces problems, when a value for $startlimit is missing. The '5' in error message looks like your $view_limit.

        Some things you should fix and/or check:
        1)  Change in line 16 + 19 of show_cart.inc.php
        ... view_cart.php?startlimit=$startlimit&sess=$sess ...

        2) Most important to remove error message (not the error itself) in line 5 should be condition:
        if ($startlimit=="" || $startlimit<0)

        3) In line 105 of view_cart.php should be:
        <input type=hidden name=startlimit value=\"$startlimit\">

        General, if you wish to check SQL-queries: Give value 3 as second argument for function db_query() like: db_query("SELECT ...", 3) or db_die();
        The the query is printed on screen :-)

        Greetings,
        Andreas.

         
    • David Rodríguez García

      Hi Andreas... Of course I understand I have to fix everything I break ;P... If I wrote the last message was just because I thought the same as you before I wrote it: I thought the problem had to be in view_cart or in limit_navi so -as you told me in yor answer- I tried to replace the files with the original ones.

      Thats how I realised the problem was in view_cart (because it works when I replaced the file) and the only change I have made in this file is the change you told me in the beggining of this message. So I thought the problem may be in the new code you gave me...

      The shop works perfect with the original configuration, but I cant reclaculate prizes and come back to an items page. If I use your new code, I can come back after recalculate but then I have a new problem If I try to come back to a page with more items that the limit...

      Maybe its easyer if you have a look in my project:
      http://www.apress.es/mysql/catalogo.html

      Thanks for your help... And sorry if Im boring you ;)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.