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...
Year: 2016
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"...
Xdebug for Magento 2
install Xdebug for php Xdebug deepens debugging PHP apps and websites to a level you can’t receive from the manual process of using code level var_dump(). Setup To install Xdebug for PHP7 on Ubuntu you will need to do so...
Events and observers
Events and observers Overview Events Dispatching events Creating new events Event areas Observers Creating an observer Subscribing to events Recommended Reading Overview Working with events and observers is one of the main ways to extend Magento functionality. The events and...
Getting list of all Manufacturers and corresponding Manufacturer ID
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'manufacturer'); foreach ( $attribute->getSource()->getAllOptions(true, true) as $option){ $attributeArray] = $option; } foreach($attributeArray as $key=>$val){ echo $val; }