This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Sets up a database with a magento2 installation. This assumes you are running from under your httpdocs/<release> location and have www.localhost.com in your /etc/hosts file | |
| # To run type : install_magento2 <dirname> <password> <release> | |
| # password is used for the datbase user and the magento admin password | |
| if [ $# -eq 0 ]; then | |
| echo "No arguments supplied" | |
| echo "Usage: `basename $0` <dirname> <password> <release>" | |
| echo "e.g install_magento2.sh mage2 password 21" | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public enum DomesticShipment { | |
| INSTANCE; | |
| private Map<String,String> domesticCountry; | |
| DomesticShipment() { | |
| domesticCountry = new HashMap<>(); | |
| domesticCountry.put("ausPost","AU"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <dirname> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Build new Image (uses dockerfile in cwd) | |
| docker build -t <your-desired-image-name> . | |
| #Run Docker Container | |
| docker run <image-name> | |
| #Stop Docker Container (if you have used --name you can then stop with actual alias name) | |
| docker stop <image-id> | |
| #Show running Docker Images |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Magento 1.x: | |
| Mage::getStoreConfig('carriers/shipper/active') | |
| Magento 2.x: | |
| protected $scopeConfig; | |
| public function __construct( | |
| \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In simple_form_bootstrap.rb: | |
| b.use :tooltip # enable the tooltip example from below. | |
| I added these everywhere I saw word placeholder. | |
| Add simple_form_components.rb: | |
| module SimpleForm | |
| module Components |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| When you type bin/magento from base directory get these module options: | |
| module | |
| module:disable Disables specified modules | |
| module:enable Enables specified modules | |
| module:status Displays status of modules | |
| module:uninstall Uninstalls modules installed by composer | |
| bin/magento module:status lists all the modules installed. You can see these in app/etc/config.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tables have moved around in Magento 2. | |
| core_resource -> setup_module | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd htdocs | |
| composer create-project magento/community-edition magento2 1.0.0-beta --prefer-dist | |
| create db (see details below) | |
| Edit setup/index.php && index.php and add this - ini_set('xdebug.max_nesting_level', 200); | |
| bin/magento setup:install --base-url=http://127.0.0.1/magento2/ \ | |
| --db-host=localhost --db-name=magento --db-user=magento --db-password=magento \ | |
| --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public java.lang.String toString() { | |
| final String newLine = System.getProperty("line.separator"); | |
| final java.lang.StringBuffer sb = new java.lang.StringBuffer("$classname{"); | |
| #set ($i = 0) | |
| #foreach ($member in $members) | |
| sb.append(newLine); | |
| #if ($i == 0) | |
| sb.append(" ## | |
| #else | |
| sb.append(" ## |