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
echo update_product("http://magento2.local/index.php/rest/V1/products/test"); | |
// following option CURLOPT_PUT breaks magento with | |
// {"message":"%fieldName is a required field.","parameters":{"fieldName":"product"}, | |
curl_setopt($ch, CURLOPT_PUT, 1 ); | |
// use CURLOPT_CUSTOMREQUEST instead | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
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
$componentReigstrar = $this->objectManager->get('\Magento\Framework\Component\ComponentRegistrarInterface'); | |
$path = $componentReigstrar->getPath(ComponentRegistrar::MODULE, 'Vendor_Modulename'); |
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\Cms\Model\PageFactory | |
$page = $this->pageFactory->create(); | |
$page->setTitle("Impressum"); | |
$page->setContent("<h1>Impressum</h1><p>Edit Me :)</p>"); | |
$page->setIdentifier('impressum'); | |
$page->setStoreId(0); | |
$page->setPageLayout("1column"); | |
$page->save(); | |
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
<?xml version="1.0"?> | |
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<referenceContainer name='sidebar.main' remove='true'/> | |
<referenceContainer name='catalog.leftnav' remove='true'/> | |
<referenceContainer name='page.main.title' remove='true'/> | |
<referenceBlock name='category.products.list'> | |
<action method='setTemplate'> | |
<argument name='template' xsi:type='string'>Vendor_Module::product/list.phtml</argument> |
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
XDEBUG_CONFIG="idekey=vim" php -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_enable=on /usr/local/bin/phpunit -c phpunit.xml |
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
<VirtualHost *:80> | |
ServerName mage2.dev | |
ProxyPreserveHost On | |
ProxyPass / http://mage2.dev:8039/ | |
ProxyPassReverse / http://mage2.dev:8039/ | |
</VirtualHost> |
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
$appState = $objectManager->get("Magento\Framework\App\State") | |
$appState->setAreaCode("frontend") | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$productFactory = $objectManager->create("\Magento\Catalog\Model\ProductFactory"); | |
$product = $productFactory->create() | |
$product->load(1) | |
$product->getData() |
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
XDEBUG_CONFIG="idekey=PHPSTORM" php -dxdebug.remote_host=192.168.56.1 -dxdebug.remote_enable=on -f bin/magento setup:upgrade |
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
$directoryReader = $objectManager->create("\Magento\Framework\Module\Dir\Reader"); | |
$moduleDirectory = $directoryReader->getModuleDir('', 'Vendor_Modulename'); | |
echo "directory of module is ".$moduleDirectory; |
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
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |