Guest User

Untitled

a guest
Apr 26th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. namespace UVAdressenObserver;
  3.  
  4. use MagentoFrameworkEventObserverInterface;
  5.  
  6. class LieferadresseEditObserver implements ObserverInterface
  7. {
  8. private $customerRepository;
  9.  
  10. public function __construct()
  11. {
  12.  
  13. }
  14.  
  15. public function execute(MagentoFrameworkEventObserver $observer)
  16. {
  17.  
  18. $address = $observer->getEvent()->getAddress();
  19. $order = $address->getOrder();
  20. print_r(get_class_methods($order)); exit;
  21. if($address->getAddressType() == 'shipping') {
  22. $billingAddress = $order->getBillingAddress();
  23. $billingAddress->setBillingAddress(**CAST $address TO SHIPPING ADDRESS?**);
  24. print_r(get_class_methods("TEST"); exit;
  25. //TODO Rechnugsaddresse befuellen
  26. }
  27. }
  28. }
  29. ?>
Add Comment
Please, Sign In to add comment