trezoteam / m2-core
Trezo Core module, with general functionality used in Magento 2 project
Installs: 15 488
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 3
Type:magento2-module
Requires
- php: ~5.6.0|>=7.0.0|~7.1.0
- magento/magento-composer-installer: *
This package is auto-updated.
Last update: 2025-03-09 10:11:07 UTC
README
General
The purpose of this module is to offer general functionality that is usefull for different Magento 2 projects.
Install in all projects and modules m2 by trezo
Install
composer require trezoteam/m2-core
Create Trezo Admin Tab
trezo
Functions
Product
getCurrentCategory
You can get the current category by using this code in the view template:
<?php $_helper = $this->helper('Trezo\Core\Helper\Product'); $currentCategory = $_helper->getCurrentCategory(); echo $currentCategory->getName(); ?>
getCurrentProduct
You can get the current product by using this code in the view template:
<?php $_helper = $this->helper('Trezo\Core\Helper\Product'); $currentProduct = $_helper->getCurrentProduct(); echo $currentProduct->getName(); ?>
Store
getCurrentStore
Return the current store
<?php $_helper = $this->helper('Trezo\Core\Helper\Store'); $currentStore = $_helper->getCurrentStore(); ?>
getLocale
Return the current locale associated with the current store.
<?php $_helper = $this->helper('Trezo\Core\Helper\Store'); echo $_helper->getLocale(); ?>
Customer
isLoggedIn
Checks if the customer is logged in
<?php $_helper = $this->helper('Trezo\Core\Helper\Customer'); $isLoggedIn = $_helper->isLoggedIn(); ?>
getCurrentCustomer
Returns the current customer if logged in. If not logged in, it will return false.
<?php $_helper = $this->helper('Trezo\Core\Helper\Customer'); $customer = $_helper->getCurrentCustomer(); ?>