Announcement

Collapse
No announcement yet.

redirect on 'add to basket'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    redirect on 'add to basket'

    Now I just bet this isn't a new thread .. but though I found some references to something like it .. nothing quite ticked the box.

    when I have an order 'added to basket' I am taken to a page which in effect says .. here's a list of what you got so far, then a few seconds later I get redirected...

    at the moment I get redirected to the top of the catalog, but what I really want is to go back to the exact same spot (preferably .. exactly the same spot .. not just the top of the page I was on) where I was a few seconds earlier.

    I can see that making the bounce setting in design>options>miscellaneous =0 seconds, results in being take straight to the checkout page (at least it did just now when I tried it) and stays there .. and I can see this might be useful .. but what would be really cool was if I could simply see the cart, then return a couple of seconds later to my current place.

    it would also be very cool if (as an alternative) I could merrily add to cart as I wander through the site and have my cart quietly absorbing the products without me going anywhere near the list of the cart's contents until I am good and ready to checkout or view the basket.

    any thoughts?

    David

    #2
    I posted a workaround that gives you the last effect you mentioned (avoiding the cart completely and returning the user to the same product). Although, as stated in the post, its by no means perfect.

    http://community.actinic.com/showthread.php?t=15980
    www.gbradley.co.uk
    Web Development, Actinic Patches, Scripts & more

    Comment


      #3
      Hi Graham.
      You know it always amazes me that folks can think this stuff up .. I wouldn't have the foggiest where to look for this stuff. I never cease to be impressed.

      That said .. I reckon I had a problem inserting that modified code and if you could shout a little louder it might be good.

      With my desperately minimal knowledge of programming I took the code and inserted it, but seeing the end } bracket a bit lower down, I inserted it over more that the single line you mentioned. I reckon I did wrong, but I'm not sure why.

      in your post you said replace :

      $sReplaceTag = $sSearchTag . "\n" . $sMetaTag;

      but, seeing that bracket and thinking, maybe you were just pointing out the location .. I highlighted :

      $sReplaceTag = $sSearchTag . "\n" . $sMetaTag;

      $sHTML =~ s/$sSearchTag/$sReplaceTag/ig; # insert the bounce meta tag

      return ($::SUCCESS, '', $sHTML, 0);
      }



      and inserted your :

      my $tempStr = "cgi-bin/ss000001.pl?SECTIONID";
      if ($ENV{'HTTP_REFERER'} =~ /$tempStr/i){
      $sReplaceTag = $sSearchTag . "\n" . $sMetaTag;
      }
      else{
      $sReplaceTag = $sSearchTag . "\n" . "</head><body><script type='text/javascript'>history.go(-1);</script></body></html>";
      }


      this broke actinic a smidgen, as when I tried to upload to the site, it failed the 'merge'. I replaced the modifed actinic.pm with the original (I may be daft, but I'm not THAT daft) and it merged ok .. so clearly I'd messed up something.

      Should I have done what you said or did I do something else silly?

      ... pity the weak minded designers. A little knowledge is clearly a very dangerous thing.

      David

      Comment


        #4
        Just replace literally the one line. Just as well you kept a backup

        Hopefully you'll get it working, but as I stated, it will effect other bounce messages such not displaying error messages when an incorrect password is supplied when logging in, or not displaying the 'no results found' message on a search with no matches. I'm sure someone else could take this further, but hopefully v8 will be more flexible when it comes to the cart bounce.
        www.gbradley.co.uk
        Web Development, Actinic Patches, Scripts & more

        Comment


          #5
          you see .. there was me briefly thinking I was being clever .. wrong wrong wrong ..

          Comment

          Working...
          X