Categories
CMS Magento Mastering Development

Visual editor for custom order attribute

It’s possible to add a visual input on user infos form, is it possible to do this to my orders ? I already add the column in filters and I did this to add the field : $salesSetup->addAttribute(Order::ENTITY, ‘order_custom_attr’, [ ‘type’ => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, ‘length’=> 255, ‘visible’ => false, ‘nullable’ => true, ]);

Categories
CMS Magento Mastering Development

Magento 2 trying to add column in installschema.php magento 2.3.5 p1

I am trying to make the length higher than 255 <?php namespace []\[]\Setup; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; class InstallSchema implements InstallSchemaInterface { public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $installer = $setup; $installer->startSetup(); if (version_compare($context->getVersion(), ‘0.0.1’) < 0) { $tableName = $installer->getTable(‘review_comment’); if ($installer->getConnection()->isTableExists($tableName) != true) { $table = $installer->getConnection() ->newTable($tableName) […]

Categories
CMS Magento Mastering Development

Customer custom value not saving to customer_enitity table

I have created new column in customer_entity table class UpgradeData implements UpgradeDataInterface{ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { if (version_compare($context->getVersion(),’1.0.6′<0)){ $customerName = $setup->getTable(‘customer_entity’); if ($setup->getConnection()->isTableExists($customerName) == true) { $connection = $setup->getConnection(); $connection->addColumn( $customerName, ‘family_name’, [ ‘type’ => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, ‘length’ => 100, ‘nullable’ => true, ‘comment’ => ‘Family Name’ ] ); } } } and […]

Categories
CMS Magento Mastering Development

Magento 2 : Avoid duplicating code Marketplace issue

I’ve submitted the extension in Marketplace and it shows below error, The files: myvendor/module-custommodule/MCS/Product.php myvendor/module-custommodule/MCS/Template.php are too similar to the Magento 2 files: magento/module-eav/magento-module-eav-102.0.0-beta32/Model/Entity/Attribute/Source/Boolean.php magento/module-config/magento-module-config-101.1.0-beta32/Model/Config/Source/Email/Template.php To avoid duplicating code, use class preferences. Template.php <?php namespace Vendor\Module\Model\Config\Source; /** * Templates classs */ class Template extends \Magento\Framework\DataObject implements \Magento\Framework\Option\ArrayInterface { /** * core Registry * * @var […]

Categories
CMS Magento Mastering Development

How to set data for my extension attribute Magento 2.3

I can’t set the value for my extension attribute , how to set the value for extension attribute using json array swagger. And i can’t show the data in the order grid. The below attribute and value can’t set. My attribute : customer_feedback Value : Hello My Module that created for extension attribute Sm\OrderFeedback\etc\di.xml <?xml […]

Categories
CMS Magento Mastering Development

How to set data for my extension attribute Magento 2.3

I can’t set the value for my extension attribute , how to set the value for extension attribute using json array swagger. And i can’t show the data in the order grid. My Module that created for extension attribute Sm\OrderFeedback\etc\di.xml <?xml version=”1.0″?> <!– File: app/code/Sm/OrderFeedback/etc/di.xml –> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\Sales\Api\OrderRepositoryInterface”> <plugin name=”sm_orderfeedback_add_order_extension_attribute” type=”Sm\OrderFeedback\Plugin\OrderRepositoryPlugin” /> […]

Categories
CMS Magento Mastering Development

How to set data for my extension attribute Magento 2.3

I can’t set the value for my extension attribute , how to set the value for extension attribute using json array swagger. And i can’t show the data in the order grid. My Module that created for extension attribute Sm\OrderFeedback\etc\di.xml <?xml version=”1.0″?> <!– File: app/code/Sm/OrderFeedback/etc/di.xml –> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\Sales\Api\OrderRepositoryInterface”> <plugin name=”sm_orderfeedback_add_order_extension_attribute” type=”Sm\OrderFeedback\Plugin\OrderRepositoryPlugin” /> […]

Categories
CMS Magento Mastering Development

How to add Custom Registeration field from admin

Hi i have a form in admin and i want that when select the type this values should reflect on an appropriate selected form but am not able to do so can anyone guide me here is a screenshot InstallSchema.php <?php /** * @category Eecom * @package Eecom_CustomCustomerAttribute */ namespace Eecom\CustomCustomerAttribute\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; […]

Categories
CMS Magento Mastering Development

How to add Custom Registeration field from admin

Hi i have a form in admin and i want that when select the type this values should reflect on an appropriate selected form but am not able to do so can anyone guide me here is a screenshot InstallSchema.php <?php /** * @category Eecom * @package Eecom_CustomCustomerAttribute */ namespace Eecom\CustomCustomerAttribute\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; […]

Categories
CMS Magento Mastering Development

Checkout custom shipping address field – set as required

I have created a custom module that adds a text field in shipping address. It’s workin ok but I’d like to make it required. How can I do that? I tried adding ‘required-entry’ => true at validation parameter, in file Plugin/Checkout/LayoutProcessor.php but it didn’t work. Here are the module files: Mymodules/FieldCheckout/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, ‘Mymodules_FieldCheckout’, […]