-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
New feature: Allow admin to create guest orders and reorder as guest #2233
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ protected function _prepareForm() | |
} | ||
} | ||
|
||
// if quote is guest, unset customer_group_id | ||
if ($this->getQuote()->getCustomerIsGuest()) { | ||
unset($attributes['group_id']); | ||
} | ||
Comment on lines
+71
to
74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment should read:
As it removes the customer group dropdown on the order create screen if we're creating a guest order. I will change and push. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,13 +274,15 @@ public function initFromOrder(Mage_Sales_Model_Order $order) | |
} | ||
|
||
/** | ||
* Check if we edit quest order | ||
* Check if we edit guest order | ||
*/ | ||
$session->setCurrencyId($order->getOrderCurrencyCode()); | ||
if ($order->getCustomerId()) { | ||
$session->setCustomerId($order->getCustomerId()); | ||
} else { | ||
$session->setCustomerId(false); | ||
$session->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID); | ||
$session->setCustomerIsGuest(true); | ||
} | ||
|
||
$session->setStoreId($order->getStoreId()); | ||
|
@@ -1266,6 +1268,10 @@ public function setAccountData($accountData) | |
$data[$code] = $customer->getData($attribute->getAttributeCode()); | ||
} | ||
|
||
if ($this->getQuote()->getCustomerIsGuest()) { | ||
$data['customer_group_id'] = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; | ||
} | ||
|
||
fballiano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (isset($data['customer_group_id'])) { | ||
$groupModel = Mage::getModel('customer/group')->load($data['customer_group_id']); | ||
$data['customer_tax_class_id'] = $groupModel->getTaxClassId(); | ||
|
@@ -1380,9 +1386,6 @@ public function _prepareCustomer() | |
{ | ||
/** @var $quote Mage_Sales_Model_Quote */ | ||
$quote = $this->getQuote(); | ||
if ($quote->getCustomerIsGuest()) { | ||
return $this; | ||
} | ||
|
||
/** @var $customer Mage_Customer_Model_Customer */ | ||
$customer = $this->getSession()->getCustomer(); | ||
|
@@ -1490,7 +1493,7 @@ public function _prepareCustomer() | |
$this->_getCustomerForm() | ||
->setEntity($customer) | ||
->resetEntityData(); | ||
} else { | ||
} elseif ($customer->getGroupId() !== Mage_Customer_Model_Group::NOT_LOGGED_IN_ID) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could also check I chose the latter because the |
||
$quote->setCustomerId(true); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if it's not part of the change wouldn't it be better to be here "Create Customer Order"? In doesn't matter if is a New Customer or a Registered one. At least we keep two buttons with a clear message:
[Create Customer Order] [Create Guest Order]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addison74 the first button really creates a new customer so I think it can be left as it is