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
<?php | |
declare(strict_types=1); | |
namespace MyNamespace\Catalog\Model; | |
use Dnd\Catalog\Api\AttributeManagementInterface; | |
use Magento\Catalog\Api\Data\ProductAttributeInterface; | |
use Magento\Eav\Api\AttributeRepositoryInterface; | |
use Magento\Eav\Api\Data\AttributeInterface; |
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
<!-- etc/graphql/di.xml --> | |
<?xml version="1.0"?> | |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | |
<type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider"> | |
<arguments> | |
<argument name="extendedConfigData" xsi:type="array"> | |
<item name="custom_foo_config" xsi:type="string">mynamespace_mymodule/general/custom_foo_config</item> | |
</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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- | |
pattern xml file name : cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml | |
--> | |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<referenceContainer name="content"> | |
<block class="\Vendor\AboutUS\Block\Custom" name="vendor.about-us.custom" template="Vendor_AboutUs::custom-template.phtml" before="-"/> | |
</referenceContainer> |
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
<?php | |
/** Quick Example how to use updateFromSelect in Magento 2 */ | |
$this->connection = $this->resourceConnection->getConnection(); | |
$this->someTable = 'some_table'; | |
$this->tmpTableName = 'tmp_table'; | |
$condition = 'ft.' . MyInterface::CRM_ID . ' = tmp.' . MyInterface::CRM_ID; | |
$condition .= ' AND ft.' . MyInterface::CODE . ' = tmp.' . MyInterface::CODE; |
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
<?php | |
namespace MyNamespace\MyModule\Plugin\Model; | |
class PaymentInformationManagementPlugin | |
{ | |
/** | |
* Here is an example how you can alter the payment methods list in the checkout. | |
* Remove free and checkmo payment methods in the checkout |
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
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<referenceBlock name="checkout.root"> | |
<arguments> | |
<argument name="jsLayout" xsi:type="array"> | |
<item name="components" xsi:type="array"> | |
<item name="checkout" xsi:type="array"> | |
<item name="steps" xsi:type="array"> | |
<item name="children" xsi:type="array"> | |
<item name="shipping-step" xsi:type="array"> |
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
<?php | |
// $this->logger = new Logger(); | |
// $this->logger->setLogFile('admin.log'); | |
// $this->logger->setTextBefore('user: '.$this->getUser()->getIdentity()->username); | |
// $this->logger->log($log); | |
class Logger { | |
private $logFile = 'logfile.log'; |
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
{{ entity.field_name.value }} to get the true raw value, includes tags and encoding. | |
Example: {{ node.body.value }} | |
result: <p>Batman & Robin</p> | |
{{ content.field_name.0 }} to get the raw value minus tags and encoding. | |
Example: {{ content.body.0 }} | |
result: Batman & Robin | |
{% set parp_state = participating_state_1|render|striptags|trim|lower %} |
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
const main = {}; | |
const updateScroll = () => { | |
main.winScroll = $(window).scrollTop(); | |
}; | |
const parallaxLoad = () => { | |
const $someEl = $('.someEl'); | |
$someEl.each((i,el) => { | |
let $el = $(el); | |
main.someEl[i] = $el; | |
}); |
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
<input type="text" id="name"/> | |
<p id="warning></p> |