Child pages
  • [in-commerce] User login/registration doesn't properly reflect on Shopping Cart [5.2.2-B1]
Skip to end of metadata
Go to start of metadata

There are 2 checkout workflows supported in In-Commerce:

  1. login/register first
    1. perform login/registration
    2. add products to Shopping Cart
    3. complete checkout
  2. login/register any time
    1. add products to Shopping Cart
    2. perform login/registration
    3. complete checkout

When user isn't logged-in during checkout process then:

  • discounts for non-logged in users only are applied
  • the Shopping Cart contents is associated with virtual Guest user

If user decides to register/login then:

  • user in Shopping Cart is changed to the one, that is now registered/logged-in
  • discounts are recalculated to reflect currently registered/logged-in user

This works fine with default In-Commerce installation, but the customized PHP code (when present) can't detect Shopping Cart user change.

Solution

In the "OrdersEventHandler::updateUserID" method change current Shopping Cart user via "OrdersItem" object instead of doing direct database update.

Related Tasks

MINC-138 - Getting issue details... STATUS

1 Comment

  1. The direct database update was used because otherwise we'll end up in situation where just logged-in user can't even set itself as owner of current order due permission check in "OrdersEventHandler::checkItemStatus" method.