You need to create Namespace/Module/view/base/ui_component/customer_form.xml and add the following code <?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=”customer”> <field name=”attribute name”> <argument name=”data” xsi:type=”array”> <item name=”config” xsi:type=”array”> <item name=”disabled” xsi:type=”boolean”>true</item> </item> </argument> </field> </fieldset> </form>
Category: Magento
Hide Custom Customer Attribute in Customer Account Information Section from Admin Panel
Step 1: Create customer_form.xml in the below path app\code\Vendor\Extension\view\base\ui_component\ And add the below code <?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=”customer”> <field name=”your_attribute_name”> <settings> <visible>false</visible> </settings> </field> </fieldset> </form>
How to Get Product Images Programmatically in Magento 2
$objectmanager = \Magento\Framework\App\ObjectManager::getInstance();$product_id = 32; //Replace with your product ID$productimages = array();$product = $objectmanager ->create(‘Magento\Catalog\Model\Product’)->load($product_id);$productimages = $product->getMediaGalleryImages();foreach($productimages as $productimage){echo “<img src=”.$productimage[‘url’]. ” width=”100″ height=”100″ />”;}
How to force a Dropbox link to download
To force a browser to download the contents of a link rather than display it, you can use dl=1 as a query parameter in your URL. For example: https://www.dropbox.com/s/a1b2c3d4ef5gh6/example.docx?dl=1 Note: The original shared link URL may contain query string parameters already (for example, dl=0). App developers should be sure to properly parse the URL and… Continue reading How to force a Dropbox link to download
Observer when updating products from Checkout
Using this observer we can monitor the update or trigger any conditions on updating the carthere we’re setting the backorders on update Considering all the stocks on the inventory and store
Observer to set backorder on adding products to the cart
Observser Code to Update the backorder to the custom field and checkout pageAlso setting the price of the products to Zero if the item is not committed
API to Update NetSuite Order Id to Magento
Here we’re calling an external API on the Magento to update a custom field on the sales order table to fetch the NetSuite Order ID to Magento 2. routes.xml
How to enable cookies from the Magento admin side?
Log in to the Magento admin backend using the credentials. Click on the stores from the sidebar. Then, click on the Configuration option Click on General->Web. Scroll down to the Default Cookie settings in the right side of the page as shown below: Cookie Restriction Mode will be the default “NO” and we need to… Continue reading How to enable cookies from the Magento admin side?
How to redirect from my account page to the homepage when a customer is logging in?
Use the below code in the di.xml file at JJ/Customproductshow/etc/frontend Paste the below code in LoginPost.php file at JJ/Customproductshow/Plugin These files should be added to an existing custom module or added to a new module.
Custom privacy policy pop-up with functionality
Here is the full code for creating a pop-up with for a privacy policy with responsive code. Html code: Css code: Javascript: Screenshot: