Moved to module: https://github.com/weprovide/magento2-module-dompdf
This file contains 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
import fetch from 'isomorphic-fetch' | |
import { saveAs } from 'file-saver' | |
fetch('/url/with/pdf', { | |
headers: { | |
'Content-Type': 'application/pdf' | |
}, | |
responseType: 'blob' | |
}).then(response => response.blob()) | |
.then(blob => saveAs(blob, 'test.pdf')) |
This file contains 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
<?php | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\ModuleDataSetupInterface; | |
function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { | |
$setup->startSetup(); | |
/** @var \Magento\Eav\Setup\EavSetup $eavSetup */ | |
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); | |
$entityTypeId = $eavSetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY); |
This file contains 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" encoding="UTF-8"?> | |
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> | |
<fieldset name="general"> | |
<field name="YOUR_ATTRIBUTE"> | |
<argument name="data" xsi:type="array"> | |
<item name="config" xsi:type="array"> | |
<item name="sortOrder" xsi:type="number">60</item> | |
<item name="dataType" xsi:type="string">boolean</item> | |
<item name="formElement" xsi:type="string">checkbox</item> |
This file contains 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
alias tower='gittower $(git rev-parse --show-toplevel)' |
This file contains 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 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<referenceBlock name="head.additional"> | |
<!-- Your block --> | |
</referenceBlock> | |
</body> | |
</page> |
define(['mage/template'], function (mageTemplate) {
// mageTemplate is a wrapper around `_.template`. See http://underscorejs.org/#template
var template = mageTemplate('<underscore.js template string>')
var html = mageTemplate({ /* optional data object */ })
document.getElementById('<id here'>).innerHTML = html
})
Magento 1.x:
Mage::getStoreConfig('carriers/shipper/active')
Magento 2.x (using constructor injection):
protected $scopeConfig;
This file contains 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
Open Slack -> Go to Edit at the menu bar -> Substitutions -> Smart Dashes |
This file contains 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
<block class="Magento\Cms\Block\Block" name="BLOCK_NAME_HERE"> | |
<arguments> | |
<argument name="block_id" xsi:type="string">STATIC_BLOCK_IDENTIFIER_HERE</argument> | |
</arguments> | |
</block> |