Skip to content

Commit

Permalink
Fix order validation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
srenon committed May 22, 2021
1 parent 7c6024e commit 2eb8a4d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 239 deletions.
126 changes: 0 additions & 126 deletions Block/Adminhtml/System/Config/Form/Composer/Version.php

This file was deleted.

78 changes: 0 additions & 78 deletions Block/Adminhtml/System/Config/Form/Module/Version.php

This file was deleted.

7 changes: 5 additions & 2 deletions Controller/Guesttocustomer/LookupformPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Framework\Data\Form\FormKey\Validator;
use Magento\Framework\View\Result\Page;
use Magento\Framework\View\Result\PageFactory;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Model\Order;
use MagePal\GuestToCustomer\Helper\Data;
Expand Down Expand Up @@ -128,11 +129,13 @@ public function execute()

/**
* @param CustomerInterface|false $customer
* @param Order $order
* @param Order | OrderInterface $order
*/
protected function addCustomerIdToOrder($customer, $order)
{
if ($customer && !$order->getCustomerId() && $order->getCustomerEmail() === $customer->getEmail()) {
if ($customer && !$order->getCustomerId()
&& strcasecmp($order->getCustomerEmail(), $customer->getEmail()) == 0
) {
$this->helperData->setCustomerData($order, $customer);

$comment = sprintf(
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
[![GitHub stars](https://img.shields.io/github/stars/magepal/magento2-guest-to-customer.svg)](https://www.magepal.com/guest-to-customer.html)
[![GitHub forks](https://img.shields.io/github/forks/magepal/magento2-guest-to-customer.svg)](https://www.magepal.com/guest-to-customer.html)

##### For Magento 2.0.x, 2.1.x, 2.2.x and 2.3.x
##### For Magento 2.0.x, 2.1.x, 2.2.x, 2.3.x and 2.4.x

<a href="https://www.magepal.com/magento2/extensions/guest-to-customer.html"><img src="https://www.magepal.com/media/catalog/product/g/u/guest-to-customer-magento.png" alt="Magento 2 customer" ></a>

In general E-commerce, shoppers do not like to create an account during checkout and often opt to checkout as a guest customer instead of a registered user. As a Magento store owner, if your online store sells products in various colors, sizes, or other customizable items then you may be dealing with canceling and rewriting orders on a daily bases because of customers' change of heart after purchasing or they simply want to be able to get order status updates. Perfect for reordering or modifying existing orders without having to manually copy all of your customer's existing billing and shipping information.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.1.3|~7.2.0|~7.3.0|~7.4.0",
"magento/module-backend": "100.0.*|100.1.*|100.2.*|101.0.*|102.0.*",
"magento/framework": "100.0.*|100.1.*|101.0.*|102.0.*|103.0.*",
"magepal/magento2-core":">1.1.0"
"magepal/magento2-core": ">=1.1.11"
},
"type": "magento2-module",
"version": "1.2.7",
Expand Down
40 changes: 9 additions & 31 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<label>Guest to Customer</label>
<tab>magepal</tab>
<resource>MagePal_GuestToCustomer::guesttocustomer</resource>
<group id="about" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="0" translate="label">
<group id="about_magepal" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="0" translate="label">
<label>About Guest to Customer</label>
<attribute type="expanded">1</attribute>
<comment><![CDATA[
<div id="magepal-info">
Copyright © 2020 <a href="https://www.magepal.com/magento2/extensions.html?utm_source=guest-to-customer&utm_medium=admin" target="_blank">MagePal, LLC</a>
<div class="magepal-info">
Copyright © 2021 <a href="https://www.magepal.com/magento2/extensions.html?utm_source=guest-to-customer&utm_medium=admin" target="_blank">MagePal, LLC</a>
<a href="https://www.magepal.com/help/docs/guest-to-customer/?utm_source=guest-to-customer&utm_medium=admin#documentation" target="_blank">Documentation</a>
<a href="https://www.magepal.com/help/docs/guest-to-customer/?utm_source=guest-to-customer&utm_medium=admin#support">Support</a>
<a href="https://www.magepal.com/help/docs/guest-to-customer?utm_source=guest-to-customer&utm_medium=admin#current_version" target="_blank">Latest Version</a>
Expand All @@ -30,32 +30,12 @@
Need to change the email address of an existing order? Download our free
<a href="https://www.magepal.com/help/docs/edit-order-email-magento2/?utm_source=guest-to-customer&utm_medium=admin">
Edit Order Email Address</a> extension today!
<hr style="border-top: 1px solid #e3e3e3" />
<style>
#magepal-info a {
font-weight: bold;
border-left: 2px solid #e3e3e3;
padding-left:10px;
padding-right:10px;
color: #ef7e1e;
}
#magepal-info a:first-child {
padding-left: 5px;
border-left: none;
}
#magepal-info {
padding-bottom: 5px;
}
.section-config.active #guesttocustomer_about-head {
padding-bottom: 0px;
}
</style>]]></comment>
<field id="composer_version" translate="label" type="label" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<hr class="magepal-hr" />
]]>
</comment>
<field id="MagePal_GuestToCustomer" translate="label" type="label" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Composer Version</label>
<frontend_model>MagePal\GuestToCustomer\Block\Adminhtml\System\Config\Form\Composer\Version</frontend_model>
<frontend_model>MagePal\Core\Block\Adminhtml\System\Config\Composer\Version</frontend_model>
</field>
</group>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
Expand All @@ -71,9 +51,7 @@
<field id="merge_customer_already_exists" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Automatically add order to customer</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>
Automatically add order to existing customer with same email address.
</comment>
<comment>Automatically add order to existing customer with same email address.</comment>
</field>
</group>
<group id="merge" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down

0 comments on commit 2eb8a4d

Please sign in to comment.