Hey folks,
Today we will going to learn fundamental of <type /> node which used in di.xml.
So let’s start without time waste let’s talk about <type /> node.
How to add product attribute value in minicart magento 2
To achieve product attribute value in minicart first need to do is create a plugin.
Create di.xml at app/code/Your/Module/etc/di.xml
Continue reading “How to add product attribute value in minicart magento 2”Knock out js Short hands
1. this.knockoutProperty /= value;
instead this.knockoutProperty(this.knockoutProperty() / value)
2.this.knockoutProperty *= value;
instead this.knockoutProperty(this.knockoutProperty() * value)
3. this.knockoutProperty -= value;
instead this.knockoutProperty(this.knockoutProperty() – value)
4. this.knockoutProperty += value;
instead this.knockoutProperty(this.knockoutProperty() + value)
How to use Zend log Magento 2
To use Zend log use below code in any PHP file.
1 2 3 4 5 6 7 8 |
$yourmessageString = 'Hey from magento zend log'; $yourmessageArray = ['Hey from magento zend log Array ']; $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log'); $logger = new \Zend\Log\Logger(); $logger->addWriter($writer); $logger->info($yourmessageString); $logger->info(print_r($yourmessageArray,true)); //for array and objects |
Programmatically create product attribute in magento.
Create file InstallData.php at app/code/Vendor/Module/Setup/InstallData.php