-
-
Notifications
You must be signed in to change notification settings - Fork 450
Do not save customer addresses when there are no changes #1579
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
Conversation
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
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.
Nice work!
->setIsCustomerSaveTransaction(true); | ||
} | ||
|
||
if (($address->getIsPrimaryBilling() || $address->getIsDefaultBilling()) |
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.
When I tested this in backend:
} else {
if ($address->getParentId() != $customer->getId()) {
$address->setParentId($customer->getId());
}
Mage::getSingleton('adminhtml/session')->addNotice("is address #{$address->getId()} save?");
if ($address->hasDataChanges()) {
$address->setStoreId($customer->getStoreId())
->setIsCustomerSaveTransaction(true)
->save();
Mage::getSingleton('adminhtml/session')->addSuccess("address #{$address->getId()} saved");
} else {
$address->setStoreId($customer->getStoreId())
->setIsCustomerSaveTransaction(true);
}
@luigifab Can you check?
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.
Yes this does not work on customer edit page.
Like this does not work when you save address on frontend.
Before merging this I would like to discuss this feature: "I also change the sort order of customer addresses, last added address is displayed first." What benefits it brings? What happens in customer account and in Backend? What happens in ordering form? |
I only changed the sort order of customer addresses collection, from |
Description
This PR do not save ALL customer addresses when the customer place an order.
I also change the sort order of customer addresses, last added address is displayed first.
OpenMage 20.0.13 / PHP 7.4.6, 8.0.11, 8.0.18
Manual testing scenarios
First, you need a customer with addresses.
app/code/core/Mage/Customer/Model/Address.php
:Contribution checklist