getEvent()->getCart();$quote=$cart?->getQuote();if(!$quote||!(int)$quote->getCustomerId()){return;}$points=0; foreach($quote->getAllVisibleItems() as $item){if((int)$item->getData('reward_redemption')){$points+=(int)$item->getData('reward_points_cost')*(int)$item->getQty();}} $quote->setData('reward_product_points',$points);$this->reservations->reserve((int)$quote->getCustomerId(),(int)$quote->getStore()->getWebsiteId(),(int)$quote->getId(),$points+(int)$quote->getData('reward_points_used')); } }