Posted on April 23, 2016, 12:31 pm, by admin, under
Tips.
Automatic Magento theme installation done through Magento Connect Manager. Here we go through manual installation steps. 1. Download a new theme and extract it. You will get app/ and skin folders. Move content of the folders to magento_dir/app and magento_dir/skin folders. 2. Login to magento admin section. Navigate to System -> Design 3. Choose store, […]
find /var/www/magento2 -type f -print0 | xargs -r0 chmod 640 find /var/www/magento2 -type d -print0 | xargs -r0 chmod 750 chmod -R g+w /var/www/magento2/{pub,var}
Magento 2 keeps db configuration in app/etc/env.php
1. Run the following: mkdir $MAGENTODIR/app/code/vendorname/modulename cd $MAGENTODIR bin/magento module:status output: List of disabled modules: Vendorname_Modulename 2. Follow by: bin/magento module:enable Vendor_Module bin/magento setup:upgrade 3. If asks for compile do the following: bin/magento setup:di:compile
Posted on April 23, 2016, 12:24 pm, by admin, under
Tips.
1. For modules, use app/code 2. For frontend – storefront templates, use app/design/frontend 3. For backend – admin templates, use app/design/adminhtml 4. For language packages, use app/i18n Database config kept in: app/etc/env.php
Posted on April 23, 2016, 12:23 pm, by admin, under
Tips.
File app/code/Vendor/Module/etc/module.xml: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Vendor_Module" setup_version="1.0.0" /> </config> has setup_version="1.0.0". If we want upgrade we should chanage to setup_version="1.0.1" and run bin/magento setup:upgrade To check run the query on db table: SELECT * FROM setup_module WHERE module=’Vendor_Module’;
<?php namespace Imran\Test\Controller\Index; use \Magento\Framework\App\Action\Action; class Index extends Action { /** @var \Magento\Framework\View\Result\Page */ protected $resultPageFactory; /** * @param \Magento\Framework\App\Action\Context $context */ public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory) { parent::__construct($context); $this->resultJsonFactory = $resultJsonFactory; } /** * Blog Index, shows a list of recent blog posts. * * @return \Magento\Framework\View\Result\JsonFactory */ public […]
<?php … $subscribe = $this->_objectManager->create(’Imran\Test\Model\Subscriber’); // Get by ID $item = $subscribe->load(19); echo $item->getName(); // Get by Email $subs = $subscribe->getCollection()->addFieldToFilter(’email’, ‘aa@bb.com’); foreach ($subs as $sub) { var_dump($sub->getData()); } …
<?php … $subscribe = $this->_objectManager->create(’Imran\Test\Model\Subscriber’); // Method 1 $subs = $subscribe->getCollection()->addFieldToFilter(’email’, ‘aa@bb.com’); var_dump($subs->getFirstItem()->getData()); // Method 2 $subs = $subscribe->getCollection() ->setPageSize(1) ->addFieldToFilter(’email’, ‘aa@bb.com’); foreach ($subs as $sub) { var_dump($sub->getData()); } …
Design customizations kept under: app/design/Vendor/theme/Vendor_Modulename/web/css app/design/Vendor/theme/Vendor_Modulename/layout app/design/Vendor/theme/Vendor_Modulename/templates