Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. use MagentoFrameworkEventObserverInterface;
  2. use MagentoFrameworkAppRequestInterface;
  3.  
  4. class CustomPrice implements ObserverInterface
  5. {
  6. public function execute(MagentoFrameworkEventObserver $observer) {
  7. $item = $observer->getEvent()->getData('quote_item');
  8.  
  9. $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
  10. $price = 100;
  11. $item->setCustomPrice($price);
  12. $item->setOriginalCustomPrice($price);
  13. $item->getProduct()->setIsSuperMode(true);
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement