Redirect to shopping cart page upon successful login if the cart exists.

@param Action $subject
@param ResultInterface $result

@return ResultInterface
7157
public function afterExecute($subject, $result)
    {

        try {
            // Pass through the original result if the customer is not logged in or the cart is empty
            if (!$this->shouldRedirectToCartPage()) {
                return $result;
            }

            // Set the flag in session to auto-open Bolt checkout on redirected (shopping cart) page
            $this->setBoltInitiateCheckout();

            // Redirect to shopping cart
            return $this->resultFactory
                ->create(ResultFactory::TYPE_REDIRECT)
                ->setPath(self::SHOPPING_CART_PATH);
        } catch (\Exception $e) {
            // On any exception pass the original result through
            $this->notifyException($e);
            return $result;
        }
    }
868457
public function afterAction($action, $result)
    {
        if (Yii::$app->user->isGuest) {
            return $result;
        } else {
            return $this->finishAuthorization();
        }
    }
671581
public function setControllerResult($result)
    {
        $event = $this->getSymfonyEvent();
        if ($event instanceof GetResponseForControllerResultEvent) {
            $event->setControllerResult($result);
        }

        return $this;
    }
290606
public function dispatch(Request $request, $result)
    {
        foreach ($request->getAcceptableContentTypes() as $mimeType) {
            /** @var \eZ\Publish\Core\REST\Common\Output\Visitor $visitor */
            foreach ($this->mapping as $regexp => $visitor) {
                if (preg_match($regexp, $mimeType)) {
                    return $visitor->visit($result);
                }
            }
        }

        throw new RuntimeException('No view mapping found.');
    }
273696
public function get( ServerRequestInterface $request, ResponseInterface $response )
	{
		$view = $this->getView();

		$allow = false;
		$id = $view->param( 'id', 'default' );

		try
		{
			try
			{
				$view->item = $this->controller->load( $id, $this->getParts( $view ) );
			}
			catch( \Aimeos\MShop\Exception $e )
			{
				$view->item = $this->controller->setType( $id )->get();
				$allow = true;
			}

			$status = 200;
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$status = 404;
			$view->errors = $this->getErrorDetails( $e, 'mshop' );
		}
		catch( \Exception $e )
		{
			$status = 500;
			$view->errors = $this->getErrorDetails( $e );
		}

		return $this->render( $response, $view, $status, $allow );
	}
910079
public function submit(UserInterface $user, $locale, &$orderWasSubmitted = true, &$originalCart = null)
    {
        $orderWasSubmitted = true;

        $cart = $this->getUserCart($user, $locale, null, false, true);
        $originalCart = $cart;

        // In case of errors, do not submit cart.
        if (count($cart->getCartErrorCodes()) > 0) {
            $orderWasSubmitted = false;

            return $cart;
        }

        $orderWasSubmitted = $this->submitCartDirectly($cart, $user, $locale);

        return $this->getUserCart($user, $locale);
    }
1072598
private function applyTransformersToResult(Result $result): Result
    {
        return empty($result->getSubresults())
            ? Result::create(
                $result->getQueryUUID(),
                $result->getTotalItems(),
                $result->getTotalHits(),
                $result->getAggregations(),
                $result->getSuggests(),
                $this
                    ->transformer
                    ->fromItems(
                        $result->getItems()
                    )
            )
            : Result::createMultiResult(
                array_map(function (Result $subresult) {
                    return $this->applyTransformersToResult($subresult);
                }, $result->getSubresults())
            );
    }
673020
protected function _post()
    {
        $subject = $this->_subject();

        $this->_trigger('beforeLogin', $subject);

        if ($user = $this->_controller()->Auth->identify()) {
            return $this->_success($subject, $user);
        }

        $this->_error($subject);
    }
488297
public function render(Subject $subject)
    {
        $this->injectViewClasses();
        $this->_ensureSuccess($subject);
        $this->_ensureData($subject);
        $this->_ensureSerialize();

        return $this->_controller()->render();
    }
800258
private function findItemBySubject(OrderInterface $order, $subject)
    {
        return $this->findTransformedItem($order, $this->itemHelper->transform($subject));
    }
2047
protected function success($message = null, $results = null)
    {
        if($message) {
            $_SESSION['flash']['message'] = $message;
            $_SESSION['flash']['type'] = 'success';
        }

        $this->trigger('html-success', $this, $message, $results);
        $this->trigger('response-success', $this, $message, $results);

        if(is_string($results)) {
            //redirect will forcefully exit
            return (string) eve()->redirect($results);
        }

        if(!is_null($results)) {
            $this->body['results'] = $results;
        }

        return $this->build($this->getTemplate());
    }
739659
protected function getResponse( $result )
    {
        $this->response
             ->setContent( xmlrpc_encode_request(
                    null, $result,
                    array( 'encoding' => 'utf-8' )
                ) );

        return $this->response;
    }
601501
public function addResult(Result $result): self
    {
        $handler = $result->getHandlerName();
        $this->results[$handler][] = $result;

        return $this;
    }
92972
protected function processResponse(ResultSet $result = null)
    {
        $this->hits = array();
        if (is_null($result)) {
            return null;
        }
        $this->collectHits($result);
        $this->collectAggregations($result);
    }
664253
public function afterExecute(
        \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save $subject,
        $result
    ) {
        $productIds = $this->attributeHelper->getProductIds();
        if (! empty($productIds)) {
            $this->catalogResource->setModified($productIds);
        }
        return $result;
    }
990247
public function afterExecute(Action $subject, $result)
    {
        // Get the code id from the original request
        $codeId = $subject->getRequest()->getParam('code_id');

        // Access protected checkoutSession property with a Closure proxy
        $getQuoteProxy = function () use ($subject) {
            return $subject->checkoutSession->create()->getQuote();
        };
        $quote = $getQuoteProxy->call($subject);

        // Remove Amasty Gift Cart from the parent (session) quote
        $this->discountHelper->removeAmastyGiftCard($codeId, $quote);

        // Access protected updateTotalsInQuote method with a Closure proxy
        $updateTotalsInQuoteProxy = function () use ($subject, $quote) {
            $subject->updateTotalsInQuote($quote);
        };
        $updateTotalsInQuoteProxy->call($subject);

        return $result;
    }
1036376
public static function after($subject, $search)
    {
        if ($search == '') {
            return $subject;
        }

        $pos = strpos($subject, $search);

        if ($pos === false) {
            return $subject;
        }

        return substr($subject, $pos + strlen($search));
    }