Commit 77adc093 by liumengfei

移除订阅模块

优化ins模块图片展示
parent 778e0dd7
......@@ -213,7 +213,7 @@
<div class="joshine-col-lg-2 joshine-col-md-2 joshine-col-sm-3 joshine-col-xs-3" style="padding-right: 2px; padding-bottom: 2px;">
<div class="instagram-media-wrapper " data-feed-data='<?= json_encode($row, true) ?>'>
<img class="instagram-media-url"
src=" <?= $row["thumbnail_url"] ?? $row["media_url"] ?> ">
src=" <?= $row["thumbnail_url"] ?? $row["media_url"] ?> " loading="lazy">
<?php if (isset($row["media_type"]) && $row["media_type"] == 'VIDEO' ) : ?>
<img class="video-icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAwoSURBVHgB7Z1LTBVZGsc/RXAAAyHack3GB2bEzHT7jG2Lj4kZFuBCYySauDEhYTRutBeMC3Qxm5atJCYTzSxYidHEiJ2oG3ojPsgYZNQODydi0ky4tA8Gw0PFmKn/vXXo4qbuvVV1q26dc+r7JUVx7620Nv75f9/5zjnfWUCMlULjKjGuYsu9yLwvMj8n8zM7Zi3XZ/M+bVwzlvsEMXMsoOgCMS01rnLjKjOvEsoPECHE+N643pqvZymCREmAEFyMkkLDPV9icwpECEHGzfs0RQDdBbiMki4nLpWAM8bpN4fUEh0FCGdbaVy/J/lczitwQ4hxmDRzRl0EiPAK0SG0quZ0boEj/mJeyqO6AIXbVdFvI9SoACeEGIdIYVdUVYDI7apJf7dzCtxQSSGqJkAWXmaUE6IqAkSo3UwsPKcoI0TZBYi8bj0lczzGPdILUWYBrqVkuI3a4MJvID6IUMpRs4wCxNTY18Th1m8gxIckmRvKJkCE22piggRuOEiSIIsAMcjYRkn3Y4JHGjcsoPBBrreV9Jk2UwExc/TFuMYpRMIUIH4If6JkyJXhFyFq4Ge+nJL/DhDhFwqBsEIwh1y5CC0kh+E8mM2oIQ65MiHWSmJu+SP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PB9aQ8eVRmAQKIDyLkldbeEJuGpN0+K7sABSxEdyDcYkYj9EFGNlQRoICFmBkIb5AUaiClmgAFLMT5KCc8gaoCFAghLqXoDVbEaVaYUZI+1KZDdQFaWWleup/yCZfDggEtzvPTSYACOGEVJRc76OKKovGj0m5nh44CtIL9KHDEGKnnjHC6N6T5MRm6C9AK3LCMkmIsN7+XCTgbQut78x6J1ndREmAqWIsIES4z70Kg+QBie29emBqDw0Wy12KUBZgOuGMxJQUp7oXmtcjyvR0iP8MSMwgKrUo+mfdpy50be5r8H1jpHR4PcheiAAAAAElFTkSuQmCC">
<?php endif; ?>
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7f02c533dc0cbf8b1519153f59f34ac0",
"content-hash": "cb060c4c55198d0b7210df32f501cb5c",
"packages": [
{
"name": "airwallex/payments-plugin-magento",
......@@ -4906,39 +4906,6 @@
"time": "2020-12-02T21:12:59+00:00"
},
{
"name": "mageside/module-subscribe-at-checkout",
"version": "1.1.7",
"dist": {
"type": "zip",
"url": "https://repo.magento.com/archives/mageside/module-subscribe-at-checkout/mageside-module-subscribe-at-checkout-1.1.7.0.zip",
"shasum": "b9abe65e74b2d202e5e6de337d7d28930e8b7219"
},
"require": {
"magento/framework": "102.0.*|103.0.*",
"magento/module-newsletter": "100.3.*|100.4.*",
"php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.0|~8.1"
},
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageside\\SubscribeAtCheckout\\": ""
}
},
"license": [
"MS-LICENSE.txt"
],
"authors": [
{
"name": "Mageside",
"email": "extensions@mageside.com",
"homepage": "https://mageside.com/"
}
]
},
{
"name": "mobiledetect/mobiledetectlib",
"version": "2.8.39",
"source": {
......
......@@ -137,7 +137,6 @@ return array(
'0b2ea8cc52669e97f3bdd7d78dcd8eb5' => $vendorDir . '/jajuma/module-webpimages/registration.php',
'c346667cd80efe409e847ee7ac6f7ce1' => $vendorDir . '/magenest/module-google-shopping/registration.php',
'eda65932675b68b5aee4503e0762d64d' => $vendorDir . '/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php',
'88ede69c0babb90b8d3e9e7a95ad0eb5' => $vendorDir . '/mageside/module-subscribe-at-checkout/registration.php',
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => $vendorDir . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
......
......@@ -69,7 +69,6 @@ return array(
'OTPHP\\' => array($vendorDir . '/spomky-labs/otphp/src'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'Metadata\\' => array($vendorDir . '/jms/metadata/src'),
'Mageside\\SubscribeAtCheckout\\' => array($vendorDir . '/mageside/module-subscribe-at-checkout'),
'Magento\\Tools\\Sanity\\' => array($baseDir . '/dev/build/publication/sanity/Magento/Tools/Sanity'),
'Magento\\Tools\\' => array($baseDir . '/dev/tools/Magento/Tools'),
'Magento\\TestFramework\\Utility\\' => array($baseDir . '/dev/tests/static/framework/Magento/TestFramework/Utility'),
......
......@@ -138,7 +138,6 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'0b2ea8cc52669e97f3bdd7d78dcd8eb5' => __DIR__ . '/..' . '/jajuma/module-webpimages/registration.php',
'c346667cd80efe409e847ee7ac6f7ce1' => __DIR__ . '/..' . '/magenest/module-google-shopping/registration.php',
'eda65932675b68b5aee4503e0762d64d' => __DIR__ . '/..' . '/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php',
'88ede69c0babb90b8d3e9e7a95ad0eb5' => __DIR__ . '/..' . '/mageside/module-subscribe-at-checkout/registration.php',
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => __DIR__ . '/..' . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
......@@ -237,7 +236,6 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
array (
'Monolog\\' => 8,
'Metadata\\' => 9,
'Mageside\\SubscribeAtCheckout\\' => 29,
'Magento\\Tools\\Sanity\\' => 21,
'Magento\\Tools\\' => 14,
'Magento\\TestFramework\\Utility\\' => 30,
......@@ -634,10 +632,6 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
array (
0 => __DIR__ . '/..' . '/jms/metadata/src',
),
'Mageside\\SubscribeAtCheckout\\' =>
array (
0 => __DIR__ . '/..' . '/mageside/module-subscribe-at-checkout',
),
'Magento\\Tools\\Sanity\\' =>
array (
0 => __DIR__ . '/../..' . '/dev/build/publication/sanity/Magento/Tools/Sanity',
......
......@@ -7094,42 +7094,6 @@
"install-path": "../magento/zendframework1"
},
{
"name": "mageside/module-subscribe-at-checkout",
"version": "1.1.7",
"version_normalized": "1.1.7.0",
"dist": {
"type": "zip",
"url": "https://repo.magento.com/archives/mageside/module-subscribe-at-checkout/mageside-module-subscribe-at-checkout-1.1.7.0.zip",
"shasum": "b9abe65e74b2d202e5e6de337d7d28930e8b7219"
},
"require": {
"magento/framework": "102.0.*|103.0.*",
"magento/module-newsletter": "100.3.*|100.4.*",
"php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.0|~8.1"
},
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageside\\SubscribeAtCheckout\\": ""
}
},
"license": [
"MS-LICENSE.txt"
],
"authors": [
{
"name": "Mageside",
"email": "extensions@mageside.com",
"homepage": "https://mageside.com/"
}
],
"install-path": "../mageside/module-subscribe-at-checkout"
},
{
"name": "mobiledetect/mobiledetectlib",
"version": "2.8.39",
"version_normalized": "2.8.39.0",
......
......@@ -2305,15 +2305,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'mageside/module-subscribe-at-checkout' => array(
'pretty_version' => '1.1.7',
'version' => '1.1.7.0',
'reference' => NULL,
'type' => 'magento2-module',
'install_path' => __DIR__ . '/../mageside/module-subscribe-at-checkout',
'aliases' => array(),
'dev_requirement' => false,
),
'mobiledetect/mobiledetectlib' => array(
'pretty_version' => '2.8.39',
'version' => '2.8.39.0',
......
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Block\Adminhtml\System\Config\Fieldset;
use Magento\Backend\Block\Template;
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Backend\Block\Template\Context;
use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\Module\ModuleList\Loader;
use Mageside\SubscribeAtCheckout\Helper\Config as Helper;
class Hint extends Template implements RendererInterface
{
/**
* @var string
*/
protected $_template = 'Mageside_SubscribeAtCheckout::system/config/fieldset/hint.phtml';
/**
* @var \Magento\Framework\App\ProductMetadataInterface
*/
protected $_metaData;
/**
* @var \Magento\Framework\Module\ModuleList\Loader
*/
protected $_loader;
/**
* @var \Mageside\SubscribeAtCheckout\Helper\Config
*/
protected $_helper;
/**
* @param Context $context
* @param ProductMetadataInterface $productMetaData
* @param Loader $loader
* @param Helper $helper
* @param array $data
*/
public function __construct(
Context $context,
ProductMetadataInterface $productMetaData,
Loader $loader,
Helper $helper,
array $data = []
) {
parent::__construct($context, $data);
$this->_metaData = $productMetaData;
$this->_loader = $loader;
$this->_helper = $helper;
}
/**
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return mixed
*/
public function render(AbstractElement $element)
{
return $this->toHtml();
}
/**
* @return mixed|string
*/
public function getModuleName()
{
return $this->_helper->getConfigModule('module_name');
}
/**
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getVersion()
{
$modules = $this->_loader->load();
$v = "";
if (isset($modules['Mageside_SubscribeAtCheckout'])) {
$v = "v" . $modules['Mageside_SubscribeAtCheckout']['setup_version'];
}
return $v;
}
/**
* @return mixed
*/
public function getModulePage()
{
if ($this->_helper->getConfigModule('is_marketplace')) {
return $this->_helper->getConfigModule('marketplace_link');
}
return $this->_helper->getConfigModule('module_page_link');
}
/**
* @return mixed
*/
public function getExtensionsPage()
{
if ($this->_helper->getConfigModule('is_marketplace')) {
return $this->_helper->getConfigModule('marketplace_extensions_link');
}
return $this->_helper->getConfigModule('extensions_link');
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Helper;
class Config extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
* Get module settings
*
* @param $key
* @return mixed
*/
public function getConfigModule($key)
{
return $this->scopeConfig->getValue(
'mageside_subscribeatcheckout/general/' . $key,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}
Mageside EULA
mageside.com
THIS LICENSE AGREEMENT (HEREINAFTER AGREEMENT) IS AN AGREEMENT BETWEEN YOU (THE
PERSON OR COMPANY WHO IS BEING LICENSED TO USE THE SOFTWARE OR DOCUMENTATION)
AND MAGESIDE (HEREINAFTER MAGESIDE/WE/US/OUR). THE AGREEMENT APPLIES TO ALL
PRODUCTS/SOFTWARE/SCRIPTS/SERVICES YOU OBTAIN FROM US.
1. By using the Software you acknowledge that you have read this Agreement,
and that you agree to the content of the Agreement and its terms, and agree
to use the Software in compliance with this Agreement.
2. The Agreement comes into legal force at the moment when you order our
Software from our site or receive it through email or on data medium at the
our discretion.
3. We are the copyright holder of the Software. The Software or a portion of it
is a copyrightable matter and is liable to protection by the law. Any
activity that infringes terms of this Agreement violates copyright law and
will be prosecuted according to the current law. We reserve the right to
revoke the license of any user who is holding an invalid license.
4. This Agreement gives you the right to use only one copy of the Software on
one Magento installation solely for your own personal or business use,
subject to all other terms of this Agreement. A separate License should be
purchased for each new Software installation. Any distribution of the Software
without our consent, including noncommercial distribution is regarded as
violation of this Agreement and entails liability, according to the current law.
5. You may not use any part of the code in whole or part in any other software
or product or website.
6. You may not give, sell, distribute, sub-license, rent, lease or lend any
portion of the Software or Documentation to anyone. You may not place the
Software on a server so that it is accessible via a public network such as
the Internet for distribution purposes.
7. You are bound to preserve the copyright information intact in the source files.
8. We reserve the right to publish a selected list of users of our Software.
9. We will not be liable to you for any damages (including any loss of
profits/saving, or incidental or consequential) caused to you, your
information and your business arising out of the use or inability to use
Software.
10. We are not liable for prosecution arising from use of the Software against
law or for any illegal use.
11. If you fail to use the Software in accordance with the terms and conditions
of this License Agreement, it constitutes a breach of the agreement, and
your license to use the program is revoked.
12. Mageside reserves the right to change this license agreement at any
time and impose its clauses at any given time.
13. License agreement remains effective until terminated. We retain the right to
terminate your license to use the Software at any time, if in its sole
discretion, you are not abiding by the terms of the Agreement, including,
but not limited to, obscuring or removing any link or copyright notice as
specified in this agreement. You may terminate it at any time by destroying
all copies of the Software. Termination of this Agreement does not bind us
to return you the amount spent for purchase of the Software.
14. If you continue to use the Software after Mageside gives you notice
of termination of your license, you hereby agree to accept an injunction to
enjoin you from its further use and to pay all costs (including but not
limited to reasonable attorney fees) to enforce our revocation of your
license and any damages suffered by us because of your misuse of
the Software.
15. This software is designed to work with a specific Magento edition and
its use on an edition other than specified is prohibited. Mageside does not
provide extension support in case of incorrect edition use.
16. Your support period and support entitlement will be defined in accordance
with the plan selected during your purchase. Within the given period you
will be eligible to receive software updates as well as technical support.
If you do not select a support plan while purchasing or obtaining this
software, free will not be available and this extension is made available
on an AS-IS basis.
17. THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS", WITHOUT WARRANTY
OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE AND DOCUMENTATION.
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\App;
use Magento\Framework\App\Config\ScopeConfigInterface;
class Config extends \Magento\Framework\App\Config
{
public function getValue(
$path = null,
$scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
$scopeCode = null
) {
if ($path == \Magento\Newsletter\Model\Subscriber::XML_PATH_CONFIRMATION_FLAG) {
return parent::getValue('mageside_subscribeatcheckout/general/send_request_email', $scope, $scopeCode);
} elseif ($path == \Magento\Newsletter\Model\Subscriber::XML_PATH_SUCCESS_EMAIL_TEMPLATE) {
return parent::getValue('mageside_subscribeatcheckout/general/send_success_email', $scope, $scopeCode);
} else {
return parent::getValue($path, $scope, $scopeCode);
}
}
}
\ No newline at end of file
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\Config\Source;
class CheckoutSubscribe implements \Magento\Framework\Option\ArrayInterface
{
const CHECKED = 1;
const NOT_CHECKED = 2;
const FORCE_INVISIBLE = 3;
const FORCE = 4;
/**
* Options getter
*
* @return array
*/
public function toOptionArray()
{
return [
['value' => self::CHECKED, 'label' => __('Checked by default')],
['value' => self::NOT_CHECKED, 'label' => __('Not Checked by default')],
['value' => self::FORCE_INVISIBLE, 'label' => __('Force subscription not showing')],
['value' => self::FORCE, 'label' => __('Force subscription')]
];
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\Config\Source;
use Mageside\SubscribeAtCheckout\Helper\Config as Helper;
/**
* Class SubscribeLayoutProcessor
*/
class SubscribeLayoutProcessor
{
/**
* @var Helper
*/
protected $_helper;
/**
* @param Helper $helper
*/
public function __construct(Helper $helper)
{
$this->_helper = $helper;
}
/**
* {@inheritdoc}
*/
public function process($jsLayout)
{
$checkbox = $this->_helper->getConfigModule('checkout_subscribe');
$checked = $checkbox == 2 ? 0 : 1;
$visible = $checkbox == 3 ? 0 : 1;
$changeable = $checkbox == 4 ? 0 : 1;
if ($this->_helper->getConfigModule('enabled')) {
$jsLayoutSubscribe = [
'components' => [
'checkout' => [
'children' => [
'steps' => [
'children' => [
'billing-step' => [
'children' => [
'payment' => [
'children' => [
'customer-email' => [
'config' => [
'template' => 'Mageside_SubscribeAtCheckout/form/element/email'
],
'children' => [
'newsletter-subscribe' => [
'config' => [
'checkoutLabel' =>
$this->_helper->getConfigModule('checkout_label'),
'checked' => $checked,
'visible' => $visible,
'changeable' => $changeable,
'template' => 'Mageside_SubscribeAtCheckout/form/element/newsletter-subscribe'
],
'component' => 'Magento_Ui/js/form/form',
'displayArea' => 'newsletter-subscribe',
]
]
]
]
]
]
],
'shipping-step' => [
'children' => [
'shippingAddress' => [
'children' => [
'customer-email' => [
'config' => [
'template' => 'Mageside_SubscribeAtCheckout/form/element/email'
],
'children' => [
'newsletter-subscribe' => [
'config' => [
'checkoutLabel' =>
$this->_helper->getConfigModule('checkout_label'),
'checked' => $checked,
'visible' => $visible,
'changeable' => $changeable,
'template' => 'Mageside_SubscribeAtCheckout/form/element/newsletter-subscribe'
],
'component' => 'Magento_Ui/js/form/form',
'displayArea' => 'newsletter-subscribe',
]
]
]
]
]
]
]
]
]
]
]
]
];
$jsLayout = array_merge_recursive($jsLayout, $jsLayoutSubscribe);
}
return $jsLayout;
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\Plugin\Checkout;
use Magento\Quote\Model\QuoteRepository;
use Magento\Checkout\Model\ShippingInformationManagement as ShippingManagement;
use Magento\Checkout\Api\Data\ShippingInformationInterface;
use Mageside\SubscribeAtCheckout\Helper\Config as Helper;
use Mageside\SubscribeAtCheckout\Model\Config\Source\CheckoutSubscribe;
class ShippingInformationManagement
{
/**
* @var \Mageside\SubscribeAtCheckout\Helper\Config
*/
protected $_helper;
/**
* @var \Magento\Quote\Model\QuoteRepository
*/
protected $_quoteRepository;
/**
* @param QuoteRepository $quoteRepository
* @param Helper $helper
*/
public function __construct(
QuoteRepository $quoteRepository,
Helper $helper
) {
$this->_quoteRepository = $quoteRepository;
$this->_helper = $helper;
}
/**
* @param ShippingManagement $subject
* @param $cartId
* @param ShippingInformationInterface $addressInformation
*/
public function beforeSaveAddressInformation(
ShippingManagement $subject,
$cartId,
ShippingInformationInterface $addressInformation
) {
if ($this->_helper->getConfigModule('enabled')) {
$newsletterSubscribe = 0;
if (in_array(
$this->_helper->getConfigModule('checkout_subscribe'),
[CheckoutSubscribe::FORCE_INVISIBLE, CheckoutSubscribe::FORCE]
)) {
$newsletterSubscribe = 1;
} elseif (($extAttributes = $addressInformation->getExtensionAttributes())
&& $extAttributes->getNewsletterSubscribe()
) {
$newsletterSubscribe = 1;
}
$quote = $this->_quoteRepository->getActive($cartId);
$quote->setNewsletterSubscribe($newsletterSubscribe);
}
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\Plugin;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Exception\MailException;
use Magento\Newsletter\Model\Subscriber;
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;
use Mageside\SubscribeAtCheckout\Helper\Config;
use Psr\Log\LoggerInterface;
class ConfirmSubscribePlugin
{
/**
* @var StoreManagerInterface
*/
private $storeManager;
/**
* @var SubscriberFactory
*/
private $subscriberFactory;
/**
* @var ScopeConfigInterface
*/
private $scopeConfig;
/**
* @var LoggerInterface
*/
private $logger;
/**
* @var Config
*/
private $configHelper;
/**
* ConfirmSubscribePlugin constructor.
* @param SubscriberFactory $subscriberFactory
* @param LoggerInterface $logger
* @param StoreManagerInterface $storeManager
* @param ScopeConfigInterface $scopeConfig
* @param Config $configHelper
*/
public function __construct(
SubscriberFactory $subscriberFactory,
LoggerInterface $logger,
StoreManagerInterface $storeManager,
ScopeConfigInterface $scopeConfig,
Config $configHelper
) {
$this->subscriberFactory = $subscriberFactory;
$this->logger = $logger;
$this->storeManager = $storeManager;
$this->scopeConfig = $scopeConfig;
$this->configHelper = $configHelper;
}
/**
* @param \Magento\Newsletter\Model\SubscriptionManager $subject
* @param callable $proceed
* @param string $email
* @param int $storeId
* @return Subscriber
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function aroundSubscribe(
\Magento\Newsletter\Model\SubscriptionManager $subject,
callable $proceed,
string $email,
int $storeId
) {
$websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId();
$subscriber = $this->subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId);
$currentStatus = (int)$subscriber->getStatus();
if ($currentStatus === Subscriber::STATUS_SUBSCRIBED) {
return $subscriber;
}
if (!$this->configHelper->getConfigModule('send_request_email')) {
$status = Subscriber::STATUS_SUBSCRIBED;
} else {
$status = $this->isConfirmNeed($storeId) ? Subscriber::STATUS_NOT_ACTIVE : Subscriber::STATUS_SUBSCRIBED;
}
if (!$subscriber->getId()) {
$subscriber->setSubscriberConfirmCode($subscriber->randomSequence());
$subscriber->setSubscriberEmail($email);
}
$subscriber->setStatus($status)
->setStoreId($storeId)
->save();
$this->sendEmailAfterChangeStatus($subscriber);
return $subscriber;
}
/**
* Sends out email to customer after change subscription status
*
* @param Subscriber $subscriber
* @return void
*/
private function sendEmailAfterChangeStatus(Subscriber $subscriber): void
{
$status = (int)$subscriber->getStatus();
if ($status === Subscriber::STATUS_UNCONFIRMED) {
return;
}
try {
switch ($status) {
case Subscriber::STATUS_UNSUBSCRIBED:
$subscriber->sendUnsubscriptionEmail();
break;
case Subscriber::STATUS_SUBSCRIBED:
$subscriber->sendConfirmationSuccessEmail();
break;
case Subscriber::STATUS_NOT_ACTIVE:
$subscriber->sendConfirmationRequestEmail();
break;
}
} catch (MailException $e) {
// If we are not able to send a new account email, this should be ignored
$this->logger->critical($e);
}
}
/**
* @param int $storeId
* @return bool
*/
private function isConfirmNeed(int $storeId): bool
{
return (bool)$this->scopeConfig->isSetFlag(
Subscriber::XML_PATH_CONFIRMATION_FLAG,
ScopeInterface::SCOPE_STORE,
$storeId
);
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Model\Plugin;
class SubscriberPlugin
{
/**
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
public $scopeConfig;
/**
* SubscriberPlugin constructor.
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
*/
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
$this->scopeConfig = $scopeConfig;
}
/**
* @param \Magento\Newsletter\Model\Subscriber $subscriber
* @param callable $proceed
*
* @return mixed
*/
public function aroundSendConfirmationSuccessEmail(
\Magento\Newsletter\Model\Subscriber $subscriber,
callable $proceed
) {
$storeId = $subscriber->getStoreId();
if ($this->scopeConfig->getValue(
'mageside_subscribeatcheckout/general/send_success_email',
'store',
$storeId
)
) {
return $proceed();
}
}
/**
* @param \Magento\Newsletter\Model\Subscriber $subscriber
* @param callable $proceed
*
* @return mixed
*/
public function aroundSendConfirmationRequestEmail(
\Magento\Newsletter\Model\Subscriber $subscriber,
callable $proceed
) {
$storeId = $subscriber->getStoreId();
if ($this->scopeConfig->getValue(
'mageside_subscribeatcheckout/general/send_request_email',
'store',
$storeId
)
) {
return $proceed();
}
}
}
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
namespace Mageside\SubscribeAtCheckout\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;
use Magento\Newsletter\Model\Subscriber;
use Mageside\SubscribeAtCheckout\Helper\Config as Helper;
use Mageside\SubscribeAtCheckout\Model\Config\Source\CheckoutSubscribe;
class OnSalesModelServiceQuoteSubmitSuccess implements ObserverInterface
{
/**
* @var \Magento\Newsletter\Model\Subscriber
*/
protected $_subscriber;
/**
* @var \Mageside\SubscribeAtCheckout\Helper\Config
*/
protected $_helper;
/**
* @var \Psr\Log\LoggerInterface
*/
protected $_logger;
/**
* @param Subscriber $subscriber
* @param Helper $helper
* @param LoggerInterface $logger
*/
public function __construct(
Subscriber $subscriber,
Helper $helper,
LoggerInterface $logger
) {
$this->_subscriber = $subscriber;
$this->_helper = $helper;
$this->_logger = $logger;
}
/**
* Subscribe to newsletters if customer checked the checkbox
*
* @param \Magento\Framework\Event\Observer $observer
* @return $this
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
if ($this->_helper->getConfigModule('enabled')) {
$quote = $observer->getQuote();
if ($quote->getNewsletterSubscribe()
|| in_array(
$this->_helper->getConfigModule('checkout_subscribe'),
[CheckoutSubscribe::FORCE_INVISIBLE, CheckoutSubscribe::FORCE]
)
) {
$email = 'undefined';
try {
$email = $quote->getCustomerEmail();
if (in_array(
$this->_helper->getConfigModule('checkout_subscribe'),
[CheckoutSubscribe::FORCE_INVISIBLE, CheckoutSubscribe::FORCE]
)) {
$subscriber = $this->_subscriber->loadByEmail($email);
if (!$subscriber->getId()) {
$this->_subscriber->subscribe($email);
}
} else {
$this->_subscriber->subscribe($email);
}
} catch (\Exception $e) {
$this->_logger->error($e->getMessage() . 'to ' . $email);
}
}
}
return $this;
}
}
Magento 2 Subscribe At Checkout by Mageside
===========================================
####Support
v1.1.7 - Magento 2.3.* - 2.4.*
####Change list
v1.1.7 - Added compatibility PHP 8.0 - 8.1 compatibility
v1.1.6 - Fixed sending emails for Magento 2.4
v1.1.5 - Fixed send confirmation success email function
v1.1.4 - Magento 2.4 support checking (updated composer.json)
v1.1.3 - Added PHP 7.3 compatibility
v1.1.2 - Added Magento 2.3 compatibility
v1.1.1 - Added config for sending confirmation email
v1.1.0 - Disable second force subscribe for the same email
v1.0.7 - Fix for Magento 2.2.5
v1.0.6 - Move config from layout to layoutProcessors
v1.0.4 - Magento 2.2 support checking (updated composer.json)
v1.0.3 - Updated composer.json
v1.0.0 - Start project
####Installation
1. Download the archive.
2. Unzip the content of archive, use command 'unzip ArchiveName.zip'. Now you have folder with name 'SubscribeAtCheckout'.
3. Make sure to create the directory structure in your Magento - 'Magento_Root/app/code/Mageside'.
4. Drop/move the unzipped folder to directory 'Magento_Root/app/code/Mageside'.
5. Run the command 'php bin/magento module:enable Mageside_SubscribeAtCheckout' in Magento root. If you need to clear static content use 'php bin/magento module:enable --clear-static-content Mageside_SubscribeAtCheckout'.
6. Run the command 'php bin/magento setup:upgrade' in Magento root.
7. Run the command 'php bin/magento setup:di:compile' if you have a single website and store, or 'php bin/magento setup:di:compile-multi-tenant' if you have multiple ones.
8. Clear cache: 'php bin/magento cache:clean', 'php bin/magento cache:flush'
{
"name": "mageside/module-subscribe-at-checkout",
"authors": [
{
"name": "Mageside",
"email": "extensions@mageside.com",
"homepage": "https://mageside.com/"
}
],
"description": "",
"type": "magento2-module",
"version": "1.1.7",
"license": [
"MS-LICENSE.txt"
],
"require": {
"php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.0|~8.1",
"magento/framework": "102.0.*|103.0.*",
"magento/module-newsletter": "100.3.*|100.4.*"
},
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageside\\SubscribeAtCheckout\\": ""
}
}
}
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Mageside_SubscribeAtCheckout::config_mageside_subscribeatcheckout" title="Mageside Subscribe At Checkout Section" />
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="mageside_all" translate="label" sortOrder="50">
<label>Mageside</label>
</tab>
<section id="mageside_subscribeatcheckout" translate="label" type="text" sortOrder="1950" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Subscribe At Checkout</label>
<tab>mageside_all</tab>
<resource>Mageside_SubscribeAtCheckout::config_mageside_subscribeatcheckout</resource>
<group id="hint" translate="label" type="text" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Mageside\SubscribeAtCheckout\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model>
</group>
<group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General</label>
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="checkout_subscribe" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Subscribe At Checkout</label>
<source_model>Mageside\SubscribeAtCheckout\Model\Config\Source\CheckoutSubscribe</source_model>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="checkout_label" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Subscribe Checkout Label</label>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="send_request_email" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Send Confirmation Request Email</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="send_success_email" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Send Confirmation Success Email</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="enabled">1</field>
</depends>
</field>
</group>
</section>
</system>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<mageside_subscribeatcheckout>
<general>
<enabled>1</enabled>
<checkout_subscribe>1</checkout_subscribe>
<send_request_email>0</send_request_email>
<send_success_email>0</send_success_email>
<checkout_label>Receive our Tutorials and Promotions newsletter</checkout_label>
<module_name>Subscribe At Checkout</module_name>
<module_page_link>https://mageside.com/subscribe-at-checkout-2.html</module_page_link>
<extensions_link>https://mageside.com</extensions_link>
<marketplace_link>https://marketplace.magento.com/mageside-module-subscribe-at-checkout.html</marketplace_link>
<marketplace_extensions_link>https://marketplace.magento.com/partner/Mageside</marketplace_extensions_link>
<!--Please, change it to 1 for the marketplace version-->
<is_marketplace>1</is_marketplace>
</general>
</mageside_subscribeatcheckout>
</default>
</config>
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="quote" resource="default">
<column xsi:type="smallint" name="newsletter_subscribe" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Newsletter Subscribe"/>
</table>
</schema>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Model\ShippingInformationManagement">
<plugin name="save-newsletter-subscribe-in-quote" type="Mageside\SubscribeAtCheckout\Model\Plugin\Checkout\ShippingInformationManagement" sortOrder="10"/>
</type>
<type name="Magento\Checkout\Api\ShippingInformationManagementInterface">
<plugin name="save-newsletter-subscribe-in-quote" type="Mageside\SubscribeAtCheckout\Model\Plugin\Checkout\ShippingInformationManagement" sortOrder="10"/>
</type>
<virtualType name="MagesideSubscribeAtCheckoutModelSubscriber" type="Magento\Newsletter\Model\Subscriber">
<arguments>
<argument name="scopeConfig" xsi:type="object">Mageside\SubscribeAtCheckout\Model\App\Config</argument>
</arguments>
</virtualType>
<type name="Mageside\SubscribeAtCheckout\Observer\OnSalesModelServiceQuoteSubmitSuccess">
<arguments>
<argument name="subscriber" xsi:type="object">MagesideSubscribeAtCheckoutModelSubscriber</argument>
</arguments>
</type>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="sales_model_service_quote_submit_success">
<observer name="ms_subscribeatcheckout_place_order_after" instance="Mageside\SubscribeAtCheckout\Observer\OnSalesModelServiceQuoteSubmitSuccess" />
</event>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Checkout\Api\Data\ShippingInformationInterface">
<attribute code="newsletter_subscribe" type="string"/>
</extension_attributes>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Block\Onepage">
<arguments>
<argument name="layoutProcessors" xsi:type="array">
<item name="subscribeConfig" xsi:type="object">Mageside\SubscribeAtCheckout\Model\Config\Source\SubscribeLayoutProcessor</item>
</argument>
</arguments>
</type>
</config>
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mageside_SubscribeAtCheckout" setup_version="1.1.7">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Newsletter"/>
<module name="Magento_Quote"/>
</sequence>
</module>
</config>
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Mageside_SubscribeAtCheckout',
__DIR__
);
<?xml version="1.0"?>
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Mageside_SubscribeAtCheckout::css/hint-styles.css"/>
</head>
</page>
<?php
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
?>
<?php /** @var Mageside\Recipe\Block\Adminhtml\System\Config\Fieldset\Hint $block */ ?>
<div class="mageside-hint">
<img src="https://mageside.com/skin/frontend/rwd/mageside_shop/images/logo.png"/><br><br>
<div class="content">
<p>
<strong class="module-name">
<?= $block->getModuleName() ?> <?= $block->getVersion() ?>
</strong>
<?= __(' by') ?>
<a target="_blank" href="https://mageside.com/">
<strong>Mageside</strong>
</a>
</p>
<p>
<?= __('Your feedback for ') ?>
<a href="<?= $block->getModulePage() ?>" target="_blank"><?php echo $block->getModuleName() ?></a>
<?= __('is highly appreciated.') ?>
</p>
<p>
<?= __('Found an issue? Need help? Got custom request? Please ') ?>
<a href="https://mageside.com/contacts/" target="_blank"><?= __('Contact us') ?></a>.
</p>
<p>
<?= __('You can check more extensions designed by our team in our ') ?>
<a href="<?= $block->getExtensionsPage() ?>" target="_blank"><?= __('Store') ?></a>.
</p>
</div>
</div>
.mageside-hint {
background: #f8f8f8;
border: 1px solid #8ba455;
margin-bottom: 10px;
padding: 11px 0 10px 10px;
color: #676056;
font: 600 12px 'Open Sans', sans-serif;
}
.mageside-hint .content {
padding-left: 30px;
}
.mageside-hint a,
.mageside-hint a:visited,
.mageside-hint a:active,
.mageside-hint a:hover,
.mageside-hint a:focus {
color: #8ba455;
}
.mageside-hint .module-name {
color: #EA7601;
}
var config = {
"map": {
"*": {
'Magento_Checkout/js/model/shipping-save-processor/payload-extender': 'Mageside_SubscribeAtCheckout/js/model/shipping-save-processor/payload-extender-override'
}
}
};
\ No newline at end of file
define([
'jquery'
], function ($) {
'use strict';
return function (payloadExtender) {
payloadExtender.addressInformation['extension_attributes'] = {
newsletter_subscribe: Boolean($('[name="newsletter-subscribe"]').attr('checked'))
};
return payloadExtender;
};
});
\ No newline at end of file
<!-- ko ifnot: isCustomerLoggedIn() -->
<!-- ko foreach: getRegion('before-login-form') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<form class="form form-login" data-role="email-with-possible-login"
data-bind="submit:login"
method="post">
<fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading">
<div class="field required">
<label class="label" for="customer-email">
<span data-bind="i18n: 'Email Address'"></span>
</label>
<div class="control _with-tooltip">
<input class="input-text"
type="email"
data-bind="
textInput: email,
hasFocus: emailFocused"
name="username"
data-validate="{required:true, 'validate-email':true}"
id="customer-email" />
<!-- ko template: 'ui/form/element/helper/tooltip' --><!-- /ko -->
<span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span>
</div>
</div>
<!-- ko foreach: getRegion('newsletter-subscribe') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--Hidden fields -->
<fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible">
<div class="field">
<label class="label" for="customer-password">
<span data-bind="i18n: 'Password'"></span>
</label>
<div class="control">
<input class="input-text"
placeholder="optional"
type="password"
name="password"
id="customer-password"
data-validate="{required:true, 'validate-password':true}" autocomplete="off"/>
<span class="note" data-bind="i18n: 'You already have an account with us. Sign in or continue as guest.'"></span>
</div>
</div>
<!-- ko foreach: getRegion('additional-login-form-fields') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<div class="actions-toolbar">
<input name="context" type="hidden" value="checkout" />
<div class="primary">
<button type="submit" class="action login primary" data-action="checkout-method-login"><span data-bind="i18n: 'Login'"></span></button>
</div>
<div class="secondary">
<a class="action remind" data-bind="attr: { href: forgotPasswordUrl }">
<span data-bind="i18n: 'Forgot Your Password?'"></span>
</a>
</div>
</div>
</fieldset>
<!--Hidden fields -->
</fieldset>
</form>
<!-- /ko -->
<!--
/**
* Copyright © Mageside. All rights reserved.
* See MS-LICENSE.txt for license details.
*/
-->
<!-- ko if: visible -->
<div class="field">
<div class="control">
<!-- ko if: changeable -->
<input class="input-text"
type="checkbox"
data-bind="
textInput: 1,
checked: checked"
name="newsletter-subscribe"
id="newsletter-subscribe" />
<label class="label" for="newsletter-subscribe">
<span data-bind="i18n: checkoutLabel"></span>
</label>
<!-- /ko -->
<!-- ko ifnot: changeable -->
<input type="checkbox"
id="newsletter-subscribe-disabled"
disabled="disabled"
checked="checked"/>
<label class="label" for="newsletter-subscribe-disabled">
<span data-bind="i18n: checkoutLabel"></span>
</label>
<!-- /ko -->
</div>
</div>
<!-- /ko -->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment