We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e4b0e0 commit 0281077Copy full SHA for 0281077
Components/Customer.php
@@ -86,15 +86,20 @@ public static function persistSession()
86
->Models()
87
->getRepository('\Shopware\CustomModels\Nosto\Customer\Customer')
88
->findOneBy(array('sessionId' => $sessionId));
89
+ $shouldPersist = false;
90
if (empty($customer)) {
91
$customer = new Customer();
92
$customer->setSessionId($sessionId);
93
+ $shouldPersist = true;
94
}
95
if ($nostoId !== $customer->getNostoId()) {
96
$customer->setNostoId($nostoId);
97
98
+ }
99
+ if ($shouldPersist) {
100
+ Shopware()->Models()->persist($customer);
101
+ Shopware()->Models()->flush($customer);
102
- Shopware()->Models()->persist($customer);
- Shopware()->Models()->flush($customer);
103
104
105
0 commit comments