Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  2. <event name="sales_order_place_before">
  3. <observer name="company_module_observer_check" instance="CompanyModuleObserverCheck" />
  4. </event>
  5. </config>
  6.  
  7. class Check implements MagentoFrameworkEventObserverInterface
  8. {
  9.  
  10. /** @var LoggerInterface */
  11. protected $logger;
  12. /**
  13. *
  14. * @param LoggerInterface $logger
  15. * @param array $data
  16. */
  17. public function __construct(LoggerInterface $logger) {
  18. $this->logger = $logger;
  19. }
  20. public function execute(MagentoFrameworkEventObserver $observer)
  21. {
  22.  
  23. //TOTO i want do things like below
  24. $condition // condition will be got from an API service
  25. if($condition){
  26. return $this;
  27. }else{
  28. return // Go back to cart
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement