Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F848111
D51.id127.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 20, 12:24 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Mon, Apr 21, 12:24 AM (12 m, 52 s)
Engine
blob
Format
Raw Data
Handle
602863
Attached To
D51: MINC-119 - Reset more fields during cloning
D51.id127.diff
View Options
Index: modules/in-commerce/units/orders/orders_event_handler.php
===================================================================
--- modules/in-commerce/units/orders/orders_event_handler.php
+++ modules/in-commerce/units/orders/orders_event_handler.php
@@ -1636,21 +1636,29 @@
{
parent::OnBeforeClone($event);
+ /** @var OrdersItem $object */
$object = $event->getObject();
- /* @var $object OrdersItem */
if ( substr($event->Special, 0, 9) == 'recurring' ) {
$object->SetDBField('SubNumber', $object->getNextSubNumber());
- $object->SetDBField('OriginalAmount', 0); // needed in this case ?
}
else {
$this->setNextOrderNumber($event);
- $object->SetDBField('OriginalAmount', 0);
}
- $object->SetDBField('OrderDate', adodb_mktime());
+
+ $reset_fields = array(
+ 'OnHold', 'OrderDate', 'ShippingCost', 'ShippingTracking', 'ShippingDate', 'ReturnTotal',
+ 'OriginalAmount', 'ShippingInfo', 'GWResult1', 'GWResult2', 'AffiliateCommission',
+ 'ProcessingFee', 'InsuranceFee',
+ );
+
+ foreach ( $reset_fields as $reset_field ) {
+ $field_options = $object->GetFieldOptions($reset_field);
+ $object->SetDBField($reset_field, $field_options['default']);
+ }
+
+ $object->SetDBField('OrderIP', $this->Application->getClientIp());
$object->UpdateFormattersSubFields();
- $object->SetDBField('GWResult1', '');
- $object->SetDBField('GWResult2', '');
}
function OnReserveItems($event)
Event Timeline
Log In to Comment