Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OXAP-348 Link newsletter subscription from old account to new account #158

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec2.0.0.h
## [3.6.9] - 2021-09-14
### Changed
- Amazon login activated permanently, removed from module settings
- Link existing newsletter subscription to new created accounts, when guest/newsletter accounts get deleted

## [3.6.8] - 2020-02-09
### Fixed
Expand Down
6 changes: 3 additions & 3 deletions application/models/bestitamazonpay4oxidloginclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ public function oxidUserExists($oUserData)
*
* @param string $sId The id of the user
*
* @return array
* @return boolean
* @throws oxConnectionException
*/
public function oxidNewsletterSubscriptionExists($sId)
{
$sSql = "SELECT *
$sSql = "SELECT OXUSERID
FROM oxnewssubscribed
WHERE OXUSERID = {$this->getDatabase()->quote($sId)}";

return $this->getDatabase()->getRow($sSql);
return $this->getDatabase()->getOne($sSql);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions ext/bestitamazonpay4oxid_oxcmp_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ public function amazonLogin()
);

// Check if a newsletter subscription existed on the old account
$aNewsletterData = $oLoginClient->oxidNewsletterSubscriptionExists($aUserData['OXID']);
if ($aNewsletterData['OXID']) {
$aNewsletterId = $oLoginClient->oxidNewsletterSubscriptionExists($aUserData['OXID']);
if ($aNewsletterId) {
$oLoginClient->linkNewsletterToNewUser($aUserData['OXID'], $sUserId);
}

Expand Down