File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2339,7 +2339,7 @@ public function afterSave(bool $isNew): void
23392339 // If we only set the owner ID an element query will be triggered. If this is a brand-new order we will encounter an error
23402340 // This is because the order record has not been saved.
23412341 // We can avoid this by simply fully setting the owner on the address element. This is also a performance optimisation to avoid an extra query.
2342- $ billingAddress ->setPrimaryOwner ($ this ); // Always ensure the address is owned by the order
2342+ $ estimatedShippingAddress ->setPrimaryOwner ($ this ); // Always ensure the address is owned by the order
23432343 Craft::$ app ->getElements ()->saveElement ($ estimatedShippingAddress , false );
23442344 $ orderRecord ->estimatedShippingAddressId = $ estimatedShippingAddress ->id ;
23452345 $ this ->setEstimatedShippingAddress ($ estimatedShippingAddress );
You can’t perform that action at this time.
0 commit comments