Magento2
Power your online business with the most flexible and scalable ecommerce platform
Magento2 use equal in email template
In this wiki we will find a way to use "==" equal in the email template, actually there is no equal in the email template itself but we can refer to a phtml file and pass a variable to it then use the if/equal in the phtml file to do this you can easily add this code to the template
in the below example we will check if the payment method is bank transfer then we will write something
Magento2 Some code paths
- Where does Magento Check the email frequency send
\vendor\magento\module-security\Model\SecurityChecker\Frequency.php
public function check($securityEventType, $accountReference = null, $longIp = null) { }
-
Use SMTP no authorization for Office 365 in Magento 2
First of all you need to install Mageplaza Extension , you can find it here
https://github.com/mageplaza/magento-2-smtp
after you create O365 SMTP connector that you may use as smtp server to allow sending out emails as group
you need to override this class
vendor\mageplaza\module-smtp\Model\Config\Source\Authentication.php
change value of None from '' into 'smtp'.
then go to the configuration and choose None and click on Save
that's it :)
Magento 2 get current category Id using registry
You need to use this in your constructer
/** * @var Magento\Framework\Registry */ private $registry;
public function __construct(\Magento\Framework\Registry $registry)
{ $this->registry = $registry; }
then you can get the current category by this code
$category = $this->registry->registry('current_category');
Disable Magento2 Inventory Modules (Reservations)
you need to disable all these modules
Magento2 .gitignore reference
Magento include a base .gitignore
file with the Magento Open Source project repository. See the latest Magento .gitignore
file. If you need to add a file that is in the .gitignore
list, you can use the -f (force) option when staging a commit:
Nice and clean one
Magento2 caching a blocks in a page
How to Change Magento2 Indexing Mode
Magento2 Checkout: remove sidebar ONLY in step 1
Add the following line to your CSS file:
.opc-summary-wrapper{
display:none;
}
Goto following directory
vendor/magento/module-checkout/view/frontend/web/js/model
And open the file step-navigator.js
Copy this file to your working theme directory.
Edit the function getActiveItemIndex in step-navigator.js You will get 0,1 etc when console.log(activeIndex);
Sections that can be updated when using Ajax request Magento2
In Magento 2, a lot work has been done in improving the response time and Sections are a part of it. Magento sets customer related data in local storage of browser in key value pair. Each key is known as section. In this post we will what sections we can update
We can use all below sections in system.xml file