PHP code example of trezoteam / m2-core

1. Go to this page and download the library: Download trezoteam/m2-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/ */

    

trezoteam / m2-core example snippets



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

echo $currentCategory->getName();


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

echo $currentProduct->getName();


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


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


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


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