-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature: added option to redirect to register page during checkout (
#39)
- Loading branch information
1 parent
5d4ed8d
commit 2cc09e0
Showing
7 changed files
with
78 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/code/core/Mage/Checkout/sql/maho_setup/maho-24.10.0.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Maho | ||
* | ||
* @category Mage | ||
* @package Mage_Core | ||
* @copyright @copyright Copyright (c) 2024 Maho (https://mahocommerce.com) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
|
||
const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; | ||
const XML_PATH_REDIRECT_REGISTER = 'checkout/options/redirect_register'; | ||
const XML_PATH_CUSTOMER_MUST_BE_LOGGED = 'checkout/options/customer_must_be_logged'; | ||
|
||
/** @var Mage_Checkout_Model_Resource_Setup $installer */ | ||
$installer = $this; | ||
|
||
$defaultConfigValue = false; | ||
foreach (Mage::app()->getWebsites(true) as $website) { | ||
$configValue = !$website->getConfig(XML_PATH_GUEST_CHECKOUT) && $website->getConfig(XML_PATH_CUSTOMER_MUST_BE_LOGGED); | ||
if ($website->getId() === 0) { | ||
$defaultConfigValue = $configValue; | ||
$this->setConfigData(XML_PATH_REDIRECT_REGISTER, $configValue); | ||
} elseif ($configValue !== $defaultConfigValue) { | ||
$this->setConfigData(XML_PATH_REDIRECT_REGISTER, true, 'websites', $website->getId()); | ||
} | ||
} | ||
|
||
$installer->endSetup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters