This topic contains 2 replies, has 2 voices, and was last updated by Frank 4 years, 7 months ago.
- Topic
Hi there,
I want to customize user_owner_id in oro_order, when a new order-record is created during the checkout-workflow.
What I have tried is to override default owner = 1, with my custom owner in CheckoutListener Class:
12345678910111213141516171819202122232425262728## OroBundle/CheckoutBundle/EventListener/CheckoutListener.php#/*** @param Checkout $checkout*/public function prePersist(Checkout $checkout){if ($this->tokenAccessor->getToken() instanceof AnonymousCustomerUserToken&& null === $checkout->getOwner()) {// dergraf 2019-09-15if($shoppingListOwner = $checkout->getSourceEntity()->getOwner()) {$checkout->setOwner($shoppingListOwner);}// oro-core-versionelse {$checkout->setOwner($this->defaultUserProvider->getDefaultUser(OroCheckoutExtension::ALIAS,Configuration::DEFAULT_GUEST_CHECKOUT_OWNER));}# ...}}#The code snippet shows both, customized and oro-core versions. It is clear, that I have to transfer working code into my own custom bundle …
However, this does not work!
After first ‘go-ahead’-button-click during the checkout process i am redirected to login-page, instead of the expected redirection to ‘Login-as-a-guest’ page (guest option has been enabled).
It seems, that it is in some-way related with the generation of workflow-record, which may be generated not as requiered …
I tried to debug it with xdebug, but could not catch the point …What did I miss to assign additionally to owner in CheckoutListener?
Thanks for help.
Frank
The forum ‘OroCommerce’ is closed to new topics and replies.