Skip to content

show an error message in adding item to the cart if the user is not logged and the item have price greater than 100 that item shouldnot added to cart

”’ public function execute(Observer $observer) { $item = $observer->getEvent()->getData(‘quote_item’); $product = $item->getProduct(); if ($product->getFinalPrice() > 100 && !$this->customerSession->isLoggedIn()) { $this->messageManager->addError(‘You need to login for adding any product worth 100 or more’); $item->getQuote()->removeItem($item->getId()); } } } ”’ work this using checkout_cart_product_add_before… Read More »show an error message in adding item to the cart if the user is not logged and the item have price greater than 100 that item shouldnot added to cart

Best way to be anonymous

Hi, first post so go easy. Is it possible to build a server or rent one online and be anonymous and zero risk of that server being asked… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1909467&goto=newpost

Looking for help to optimize new server

I have a new server with Cloudlinux and Litespeed. I am looking for some help to optimize it properly. Most of my clients have websites wi… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1909412&goto=newpost