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 | |
declare(strict_types=1); | |
namespace MyNamespace\MyModule\Setup\Patch\Data; | |
use Magento\Customer\Api\Data\CustomerInterface; | |
use Magento\Customer\Model\Customer; | |
use Magento\Eav\Api\AttributeRepositoryInterface; | |
use Magento\Eav\Setup\EavSetupFactory; |
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
Method @POST : www.mydomaine.com/rest/{storeCode}/V1/company | |
{ | |
"company": { | |
"status": 1, | |
"company_name": "MY COMPANY", | |
"company_email": "[email protected]", | |
"street": [ | |
"10 rue du test" | |
], |
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 | |
declare(strict_types=1); | |
namespace MyNamespace\MyModule\Setup\Patch\Data; | |
use Magento\Catalog\Api\Data\EavAttributeInterface; | |
use Magento\Catalog\Api\Data\ProductAttributeInterface; | |
use Magento\Eav\Setup\EavSetupFactory; | |
use Magento\Framework\Setup\Patch\DataPatchInterface; |
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 | |
declare(strict_types=1); | |
namespace MyNamespace\MyModule\Setup\Patch\Data; | |
use Magento\Framework\App\Config\Storage\WriterInterface; | |
use Magento\Framework\Exception\FileSystemException; | |
use Magento\Framework\Filesystem\Driver\File; | |
use Magento\Framework\Module\Dir; |
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"?> | |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> | |
<group name="quote_item"> | |
<attribute name="my_custom_attribute"/> | |
</group> | |
</config> |
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
#Let's find the attribute_id of price | |
SELECT attribute_id, backend_type | |
FROM `eav_attribute` | |
WHERE attribute_code = 'price' AND entity_type_id = 4; | |
# For instance the attribute_id returned is 77 | |
# /!\ Warning /!\ | |
# Community Edition : use `entity_id` | |
# Enterprise Edition : use `row_id` |
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 | |
declare(strict_types=1); | |
namespace MyNamespace\MyModule\Plugin; | |
use Vendor\Module\Block\Any\Block as AnyBlock; | |
/** | |
* Class AddViewModelToBlock |
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" ?> | |
<!-- | |
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 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_config" xsi:type="string">mynamespace_mymodule/general/custom_config</item> | |
</argument> |
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 | |
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; |
NewerOlder