Sometimes default PrestaShop back-office configuration is not user-friendly for some store owners. Luckily, there are plenty of ways to customize it. For instance, today I want to share with you some tips on configuring sorting fields in Prestashop back-office. (more…)
We are used to see Helper as an element that is global and always available. It’s created as a Singleton.
Everybody used the following construction: Mage::helper(‘[Modul] / [Helper Name]’)
Where do you need it?
You need it in templates. In our modules, when creating classes, we can define any unnecessary subjects in construct. But it doesn’t seem right to redefine other’s classes when coding, does it?
So how can you do it in Magento 2.0?
In Magento 2.0 templates there is a main object: $block.
Its class is a block that corresponds to the template.
Here you can also find our old famous variable $this.
Its class is Magento\Framework\View\TemplateEngine\Php
And here comes our “our precious”!