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’, […]

Categories
CMS Magento Mastering Development

Add install data dropdown in phtml file and save in database

Basically i have create a database column for drop-down using Install data .Now i am confused how to get this in phtml file and save into database Install schema <?php namespace Custom\CustomRegistration\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Customer\Model\Customer; use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet; use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; /** * @codeCoverageIgnore */ class […]

Categories
CMS Development Magento

Magento 2 custom form in shipping address before-form not validating for registered customers

I have added a custom form in the shipping address before-form handle. This form is validating for a guest checkout process but not working for logged in customers who have already added address information. Below is my Layoutprocessor file where am injecting the custom field to shipping step before-form handle. $customAttributeCode = ‘experience_survey_option’; $customField = […]

Categories
CMS Development Magento

Magento 2 custom form in shipping address before-form not validating for registered customers

I have added a custom form in the shipping address before-form handle. This form is validating for a guest checkout process but not working for logged in customers who have already added address information. Below is my Layoutprocessor file where am injecting the custom field to shipping step before-form handle. $customAttributeCode = ‘experience_survey_option’; $customField = […]

Categories
CMS Development Magento

Magento 2 custom form in shipping address before-form not validating for registered customers

I have added a custom form in the shipping address before-form handle. This form is validating for a guest checkout process but not working for logged in customers who have already added address information. Below is my Layoutprocessor file where am injecting the custom field to shipping step before-form handle. $customAttributeCode = ‘experience_survey_option’; $customField = […]

Categories
CMS Development Magento

Create attribute option using Data patch in Magento2

I am creating a product attribute with option using Magento 2.3 Data patch. Used below code. <?php declare(strict_types=1); namespace Vendor\Module\Setup\Patch\Data; use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\Patch\DataPatchInterface; class AddFeatureAttribute implements DataPatchInterface { private $moduleDataSetup; private $eavSetupFactory; public $_storeManager; private $logger; protected $_dir; public function __construct( ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory, \Psr\Log\LoggerInterface $logger, \Magento\Store\Model\StoreManagerInterface […]

Categories
CMS Development Magento

Extension not installing database values

I installed a free magento extension on two magento sites. both sites are working fine after install, but one site i notice missing some features (the tab in edit category page and it’s page) Then i compare two databases and found there have some missing values on one site, then i tried to disable extension, […]

Categories
CMS Development Magento

input element not getting disabled when I change it’s property “disabled”

I have created a custom module to add some fields to the order checkout however I have some troubles enabling them conditionally. I have a radio button and 4 elements When the radio is clicked, depending on the value, I change the 4 fields to disabled=false or disabled=true and I would like the input fields […]

Categories
CMS Development Magento

Custom customer attribute not showing in admin customer grid table

I have created an ph:Number customer attribute for the customer registration form . But now i am facing an issue in which that attribute in not showing in the back-end customer grid the phone number attribute in the above picture is what i created and the code is mentioned below Method in my Install Schema […]