Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use MagentoFrameworkEventObserverInterface;
- use MagentoFrameworkAppRequestInterface;
- class CustomPrice implements ObserverInterface
- {
- public function execute(MagentoFrameworkEventObserver $observer) {
- $item = $observer->getEvent()->getData('quote_item');
- $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
- $price = 100;
- $item->setCustomPrice($price);
- $item->setOriginalCustomPrice($price);
- $item->getProduct()->setIsSuperMode(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement