In the root directory of your Drupal site, create a folder called mytheme in the themes folder. Inside the mytheme folder, create a mytheme.info.yml le so that Drupal can discover the theme. We will then edit this le First, we...
Month: October 2016
Drupal 8 study note 3: Providing the con guration on installation or update
Create a config folder in your module's base directory. All con guration YAMLs should be in a subfolder of Create a folder named install in the config folder. Con guration YAMLs in this folder will be imported on module installation....
Drupal 8 study note 2: Defining permissions
Permissions are stored in a mymodule.permissions.yml le. Add a mymodule. permissions.yml to the base directory of your module. First, we need to de ne the internal string used to identify this permission, such as view mymodule pages: view mymodule pages:...
Drupal 8 study note 1 Altering existing routes
Altering existing routes Create src/Routing/RouteSubscriber.php in your module. It will hold the route subscriber class: <?php namespace Drupal\mymodule\Routing; use Drupal\Core\Routing\RouteSubscriberBase; use Symfony\Component\Routing\RouteCollection; class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public function alterRoutes(RouteCollection $collection) { // Change path of...
Magento 2 add static Block
To update cms static block for particular store programmatically you can use following code $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $identifier = 'block_identifier'; $store_id = 2; try { $block = $objectManager->create('Magento\Cms\Model\Block'); $block->setStoreId($store_id); // store for block you want to update $block->load($identifier, 'identifier'); $block->setIdentifier($identifier);...
Magento 2: How to truncate customers, products, reviews and orders table
http://magento.stackexchange.com/questions/102936/magento-2-how-to-truncate-customers-products-reviews-and-orders-table SET FOREIGN_KEY_CHECKS = 0; Truncate order tables TRUNCATE TABLE `gift_message`; TRUNCATE TABLE `quote`; TRUNCATE TABLE `quote_address`; TRUNCATE TABLE `quote_address_item`; TRUNCATE TABLE `quote_id_mask`; TRUNCATE TABLE `quote_item`; TRUNCATE TABLE `quote_item_option`; TRUNCATE TABLE `quote_payment`; TRUNCATE TABLE `quote_shipping_rate`; TRUNCATE TABLE `reporting_orders`; TRUNCATE TABLE...
vagrant reinstall virtualbox ssh lost default: Error: Authentication failure. Retrying…
ssh vagrant@localhost -p 2222 then copy the public key content fromhttps://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub to the authorised_keys file with the following command echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > .ssh/authorized_keys When done exit the VM and try vagrant ssh again. It should...
Add a custom tab in product page Magento2
Add a custom tab in product page Magento2 1. Create new attribute in Magento 2 Add Custom Tab to Product Page Go to this link: admin > Store > Product > Add New Attribute 2. Select a Attribute Sets for...
MAGENTO 2 TROUBLESHOOTING: HOW TO RESOLVE FILE_GET_CONTENTS /VAR/DI/SETUP.SER FAILED TO OPEN STREAM
Solution! It turns out all I had to do was clear just the /var/di folder before running the upgrade command with: rm -rf var/di
magento 1.x Mage_Customlogin_Helper_Data’ not found in …./app/Mage.php on line 546″
I follow the article in Internet , 1.check the config.xml <global> <blocks> <customerlogin> <class>CustomerParadigm_Customerlogin_Block</class> </customerlogin> </blocks> <helpers> <customerParadigm_customerlogin> <class>CustomerParadigm_Customerlogin_Helper</class> </customerParadigm_customerlogin> </helpers> it is ok finally I found the problem from system.xml and remove module="customlogin" it work ! <groups> <general translate="label"...