Skip to content

Commit

Permalink
Refs #4909 Only update the visitEcommerceStatus flag if it's differen…
Browse files Browse the repository at this point in the history
…t from current value.
  • Loading branch information
mattab committed Mar 26, 2014
1 parent 12d78a1 commit 25bfb48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/Tracker/Visit.php
Expand Up @@ -944,7 +944,9 @@ protected function getExistingVisitFieldsToUpdate($action, $visitIsConverted)
// Ecommerce buyer status
$visitEcommerceStatus = $this->goalManager->getBuyerType($this->visitorInfo['visit_goal_buyer']);

if($visitEcommerceStatus != GoalManager::TYPE_BUYER_NONE) {
if($visitEcommerceStatus != GoalManager::TYPE_BUYER_NONE
// only update if the value has changed (prevents overwriting the value in case a request has updated it in the meantime)
&& $visitEcommerceStatus != $this->visitorInfo['visit_goal_buyer']) {
$valuesToUpdate['visit_goal_buyer'] = $visitEcommerceStatus;
}

Expand Down

0 comments on commit 25bfb48

Please sign in to comment.