Rating showing twice on product pages in Magento
We came across an issue recently, where the customer’s product pages review section was showing the rating stars twice. Here is the quick fix . Just goto the phpmyadmin and run this SQL query, [php] TRUNCATE `rating_option_vote` ; TRUNCATE `rating_option_vote_aggregated` ; [/php] …
How to Check, Customer is Logged in or not in Magento2
Below script will helpful to find the customer currently logged in a website or not. [php] $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $objectManager->create(‘Magento\Customer\Model\Session’); if($customerSession->isLoggedIn()) { //customer is loggedin or not $customerSession->getCustomer()->getName(); //Loggedin customer Name $customerSession->getCustomer()->getEmail(); //Loggedin customer Email //print_r($customerSession->getCustomer()->getData()); } [/php] Or You can try below …