Type
magento2-module
Studio Emma Core module, with general functionality used in Magento 2 project
magento2-module
OSL-3.0
None
None
None
None
None
The purpose of this module is to offer general functionality that is usefull for different Magento 2 projects.
You can get the current category by using this code in the view template:
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Product');
$currentCategory = $_helper->getCurrentCategory();
echo $currentCategory->getName();
?>
You can get the current product by using this code in the view template:
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Product');
$currentProduct = $_helper->getCurrentProduct();
echo $currentProduct->getName();
?>
Return the current store
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Store');
$currentStore = $_helper->getCurrentStore();
?>
Return the current locale associated with the current store.
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Store');
echo $_helper->getLocale();
?>
Checks if the customer is logged in
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Customer');
$isLoggedIn = $_helper->isLoggedIn();
?>
Returns the current customer if logged in. If not logged in, it will return false.
<?php
$_helper = $this->helper('StudioEmma\Core\Helper\Customer');
$customer = $_helper->getCurrentCustomer();
?>