Question for the OXID developers (superfluous redirect after adding an article to the cart)

Currently the “public function tobasket” in “views/oxcmp_basket.php” forces a redirect , which means a complete restart of the current function on the server.

$sReturn = $this->_getRedirectUrl();

However, IMO this redirect is not necessary at all, so it is just wasting time…

If you comment out the “$sReturn = $this->_getRedirectUrl();” the shop works perfectly well still, and I could not find any adverse effect doing so.

[B]So, why are you redirecting at that stage?[/B]

Hi,
it you look at _getRedirectUrl(); you will see this:


 // reload and backbutton blocker
        if ( $this->getConfig()->getConfigParam( 'iNewBasketItemMessage' ) == 3 ) {
...

so two things to consider:

  1. if in config iNewBasketItemMessage is set to 3, after putting article to basket, it will be redirected to basket window
  2. if no redirect and user after adding article to basket will click browsers back button, it will show resend POST form, or simply adds another article

this is why redirect is build for :slight_smile: