Skip to content

Commit

Permalink
FE API: disable cart migrating functionality
Browse files Browse the repository at this point in the history
- the current cart migration implementation does not work in the FE API so it is useless and dangerous to even try it (the session is started in the process which is unwanted in the API)
  • Loading branch information
vitek-rostislav committed Jul 26, 2022
1 parent 27b198d commit ca2cc5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/framework/src/Model/Cart/CartMigrationFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public function mergeCurrentCartWithCart(Cart $cart): void
*/
public function onKernelController(ControllerEvent $event): void
{
$controller = $event->getController();
$frontendApiControllerName = 'Shopsys\FrontendApiBundle\Controller\FrontendApiController';
if (class_exists($frontendApiControllerName) && isset($controller[0]) && get_class($controller[0]) === $frontendApiControllerName) {
return;
}
$session = $event->getRequest()->getSession();

$previousCartIdentifier = $session->get(static::SESSION_PREVIOUS_CART_IDENTIFIER);
Expand Down

0 comments on commit ca2cc5b

Please sign in to comment.