PHP code example of studioemma / magento2-module-core

1. Go to this page and download the library: Download studioemma/magento2-module-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

studioemma / magento2-module-core example snippets



$_helper = $this->helper('StudioEmma\Core\Helper\Product');
$currentCategory = $_helper->getCurrentCategory();

echo $currentCategory->getName();


$_helper = $this->helper('StudioEmma\Core\Helper\Product');
$currentProduct = $_helper->getCurrentProduct();

echo $currentProduct->getName();


$_helper = $this->helper('StudioEmma\Core\Helper\Store');
$currentStore = $_helper->getCurrentStore();


$_helper = $this->helper('StudioEmma\Core\Helper\Store');
echo $_helper->getLocale();


$_helper = $this->helper('StudioEmma\Core\Helper\Customer');
$isLoggedIn = $_helper->isLoggedIn();


$_helper = $this->helper('StudioEmma\Core\Helper\Customer');
$customer = $_helper->getCurrentCustomer();