<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rajat kar - Tag Vibe</title>
	<atom:link href="https://www.tagvibe.com/author/rajat/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tagvibe.com</link>
	<description>Connect. Create. Conquer.</description>
	<lastBuildDate>Mon, 06 May 2024 09:46:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://www.tagvibe.com/wp-content/uploads/2024/05/cropped-cropped-logo-tagvibe-1-32x32.png</url>
	<title>Rajat kar - Tag Vibe</title>
	<link>https://www.tagvibe.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to effectively use cache in Adobe Commerce(Magento)</title>
		<link>https://www.tagvibe.com/magento2-cache/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Tue, 14 Mar 2023 18:51:54 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[magento2]]></category>
		<category><![CDATA[pagespeed]]></category>
		<guid isPermaLink="false">https://tagvibe.com/?p=274</guid>

					<description><![CDATA[<p>Caching is an important aspect of optimizing website performance in Magento. Here are some ways to effectively use cache in Adobe Commerce: Best Practices for caching Types Cache: Create a custom cache list in Magento In this code, replace &#60;Vendor&#62; with the name of your module vendor, and &#60;Module&#62; with the name of your module. Also, replace CustomCacheType with the name of your custom cache type. In this code, replace &#60;Vendor&#62; with the name of your module vendor, and &#60;Module&#62; with the name of your module. Also, replace CustomCacheType with the name of your custom cache type. Once your custom cache type is added, you can use it to cache custom data or functionality in your module. By effectively using cache in Adobe Commerce, you can significantly improve the performance of your website and provide a better user experience for your customers. Also read the what is partial caching in Mageto 2</p>
<p>The post <a href="https://www.tagvibe.com/magento2-cache/">How to effectively use cache in Adobe Commerce(Magento)</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-44">Caching is an important aspect of optimizing website performance in Magento. Here are some ways to effectively use cache in Adobe Commerce:</p>



<h2 class="wp-block-heading gtfy-47">Best Practices for caching</h2>



<ul class="wp-block-list gtfy-57">
<li class="gtfy-50 gutenify-list-item"><strong>Enable Full Page Cache (FPC</strong>): Adobe Commerce comes with a built-in Full Page Cache that can dramatically speed up the loading time of pages. Enabling FPC can be done by going to System &gt; Cache Management &gt; Full Page Cache and selecting &#8220;Enable&#8221; from the drop-down menu. Once enabled, FPC will store the HTML of each page, reducing the amount of processing required to generate each page.</li>



<li class="gtfy-51 gutenify-list-item"><strong>Use Varnish Cache: </strong>Varnish Cache is a powerful caching solution that can be used in conjunction with Adobe Commerce&#8217;s built-in FPC. Varnish Cache sits between the web server and the client and caches the content of each request, serving cached content to subsequent requests. To enable Varnish Cache, you need to configure it in your web server and configure Adobe Commerce to use it as a caching proxy.</li>



<li class="gtfy-52 gutenify-list-item"><strong>Use Redis Cache:</strong> Redis is an in-memory key-value store that can be used as a cache backend for Adobe Commerce. By default, Adobe Commerce uses file-based caching, which can be slow and inefficient. Redis can be faster and more efficient because it stores data in memory instead of on disk. To use Redis Cache in Adobe Commerce, you need to install and configure the Redis extension, and then configure Adobe Commerce to use Redis as a cache backend.</li>



<li class="gtfy-53 gutenify-list-item"><strong>Use Content Delivery Networks (CDN): </strong>A CDN is a network of servers that cache static content, such as images, CSS, and JavaScript files, and serves them from the server closest to the user. This can dramatically improve the loading time of static content and reduce the load on your server. Adobe Commerce has built-in support for CDN integration, which can be configured under System &gt; Configuration &gt; Web &gt; CDN.</li>



<li class="gtfy-56 gutenify-list-item"><strong>Monitor Cache Performance: </strong>It&#8217;s important to regularly monitor the performance of your caching solutions to ensure they are working effectively. You can use tools like New Relic or Blackfire to monitor the performance of your website and identify any caching-related issues.
<ul class="wp-block-list gtfy-55">
<li class="gtfy-54 gutenify-list-item"></li>
</ul>
</li>
</ul>



<h2 class="wp-block-heading gtfy-60">Types Cache:</h2>



<ul class="wp-block-list gtfy-73">
<li class="gtfy-63 gutenify-list-item"><strong>Configuration Cache</strong>: Stores configuration settings for the website, including the website&#8217;s system configuration and database configuration.</li>



<li class="gtfy-64 gutenify-list-item"><strong>Layout Cache</strong>: Stores the layout of pages and blocks on the website, including the position of blocks, their content, and other layout settings.</li>



<li class="gtfy-65 gutenify-list-item"><strong>Block Cache</strong>: Stores the HTML output of blocks on the website, reducing the amount of processing required to generate each page.</li>



<li class="gtfy-66 gutenify-list-item"><strong>Collections Data Cache</strong>: Stores data related to collections, such as product or category data, to speed up database queries.</li>



<li class="gtfy-67 gutenify-list-item"><strong>Reflection Cache</strong>: Stores metadata about classes and interfaces, reducing the amount of time required to load and process classes.</li>



<li class="gtfy-68 gutenify-list-item"><strong>Page Cache</strong>: Stores the entire HTML output of a page, including dynamic content, to reduce the amount of processing required to generate each page.</li>



<li class="gtfy-69 gutenify-list-item"><strong>EAV Cache:</strong> Stores data related to entities, attributes, and values, speeding up database queries.</li>



<li class="gtfy-70 gutenify-list-item">Translations Cache: Stores translations for the website, reducing the amount of processing required to generate translated content.</li>



<li class="gtfy-71 gutenify-list-item">I<strong>ntegration Configuration Cache</strong>: Stores configuration settings for integrations, including third-party integrations and APIs.</li>



<li class="gtfy-72 gutenify-list-item"><strong>Web API Cache</strong>: Stores data related to the Magento Web API, reducing the amount of processing required to generate API responses.</li>
</ul>



<h2 class="wp-block-heading gtfy-76">Create a custom cache list in Magento</h2>



<ul class="wp-block-list gtfy-81">
<li class="gtfy-79 gutenify-list-item">Create a new file named <code>cache.xml</code> in the directory <code>app/code/&lt;Vendor&gt;/&lt;Module&gt;/etc/</code>.</li>



<li class="gtfy-80 gutenify-list-item">In the cache.xml file, define the custom cache type by adding the following code:</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-84" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="<config xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Cache/etc/cache.xsd&quot;&gt;
   <type name=&quot;custom_cache_type&quot; translate=&quot;label description&quot; instance=&quot;<Vendor&gt;\<Module&gt;\Cache\Type\CustomCacheType&quot;&gt;
       <label&gt;Custom Cache Type</label&gt;
       <description&gt;Custom Cache Type Description</description&gt;
   </type&gt;
</config&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;config</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xmlns</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">xsi</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2001/XMLSchema-instance</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">noNamespaceSchemaLocation</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">urn:magento:framework:Cache/etc/cache.xsd</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">&lt;type</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">custom_cache_type</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">translate</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">label description</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">instance</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">&lt;Vendor&gt;\&lt;Module&gt;\Cache\Type\CustomCacheType</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">       </span><span style="color: #81A1C1">&lt;label&gt;</span><span style="color: #D8DEE9FF">Custom Cache Type</span><span style="color: #81A1C1">&lt;/label&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">       </span><span style="color: #81A1C1">&lt;description&gt;</span><span style="color: #D8DEE9FF">Custom Cache Type Description</span><span style="color: #81A1C1">&lt;/description&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">&lt;/type&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/config&gt;</span></span></code></pre></div>



<p class="gtfy-87">In this code, replace <code>&lt;Vendor&gt;</code> with the name of your module vendor, and <code>&lt;Module&gt;</code> with the name of your module. Also, replace <code>CustomCacheType</code> with the name of your custom cache type.</p>



<ul class="wp-block-list gtfy-92">
<li class="gtfy-90 gutenify-list-item">Create a new file named CustomCacheType.php in the directory app/code///Cache/Type/.</li>



<li class="gtfy-91 gutenify-list-item">In the <code>CustomCacheType.php</code> file, define the custom cache type class by adding the following code:</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-95" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="<?php
namespace <Vendor&gt;\<Module&gt;\Cache\Type;
class CustomCacheType extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
{
   const TYPE_IDENTIFIER = 'custom_cache_type';
   const CACHE_TAG = 'CUSTOM_CACHE_TYPE';
   public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool)
   {
       parent::__construct($cacheFrontendPool-&gt;get(self::TYPE_IDENTIFIER), self::CACHE_TAG);
   }
}
" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php</span></span>
<span class="line"><span style="color: #81A1C1">namespace</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">&lt;Vendor&gt;\&lt;Module&gt;\Cache\Type;</span></span>
<span class="line"><span style="color: #D8DEE9FF">class CustomCacheType extends </span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Cache</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Frontend</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Decorator</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">TagScope</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> TYPE_IDENTIFIER </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">custom_cache_type</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> CACHE_TAG </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">CUSTOM_CACHE_TYPE</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">__construct</span><span style="color: #ECEFF4">(\</span><span style="color: #D8DEE9FF">Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">App</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Cache</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Type</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">FrontendPool</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">cacheFrontendPool</span><span style="color: #ECEFF4">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">       </span><span style="color: #81A1C1">parent::</span><span style="color: #88C0D0">__construct</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">cacheFrontendPool</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">get</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">self::</span><span style="color: #D8DEE9FF">TYPE_IDENTIFIER</span><span style="color: #ECEFF4">),</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">self::</span><span style="color: #D8DEE9FF">CACHE_TAG</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span>
<span class="line"></span></code></pre></div>



<p class="gtfy-98">In this code, replace <code>&lt;Vendor&gt;</code> with the name of your module vendor, and <code>&lt;Module&gt;</code> with the name of your module. Also, replace <code>CustomCacheType</code> with the name of your custom cache type.</p>



<ul class="wp-block-list gtfy-102">
<li class="gtfy-101 gutenify-list-item">Clear the cache by running the following command in the Magento 2 root directory:</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-105" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="php bin/magento cache:clean
" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #D8DEE9FF">php </span><span style="color: #A3BE8C">bin/magento</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">cache:clean</span></span>
<span class="line"></span></code></pre></div>



<ul class="wp-block-list gtfy-109">
<li class="gtfy-108 gutenify-list-item">Verify that your custom cache type is listed in the cache list by going to System &gt; Cache Management in the Magento 2 admin panel.</li>
</ul>



<p class="gtfy-112">Once your custom cache type is added, you can use it to cache custom data or functionality in your module.</p>



<p class="gtfy-115">By effectively using cache in Adobe Commerce, you can significantly improve the performance of your website and provide a better user experience for your customers.</p>



<p class="gtfy-118">Also read the <a href="https://tagvibe.com/partial-caching-in-magento-2/">what is partial caching in Mageto 2</a></p><p>The post <a href="https://www.tagvibe.com/magento2-cache/">How to effectively use cache in Adobe Commerce(Magento)</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Magento2: Apply ACL to custom field</title>
		<link>https://www.tagvibe.com/magento2-apply-acl-to-custom-field/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 17:28:53 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[ACl]]></category>
		<category><![CDATA[custom-field]]></category>
		<category><![CDATA[magento2]]></category>
		<guid isPermaLink="false">https://tagvibe.com/?p=217</guid>

					<description><![CDATA[<p>Magento 2 Admin ACL panel uses an authentication system and a robust system for creating Access Control List Rules (ACL), which allows a store owner to create fine-grained roles for each user in their system. Magento 2 Access Control List RulesThe Magento 2 Admin ACL resources are visible under the Magento 2 admin System &#62; Permissions &#62; User Roles area. When we click on the Add New Role button or access a role.&#160; In Magento 2, we can apply the ACL rule in the menu or form, but this article will help you apply the ACL rule on specific filed in the form. Step: 1 Create a UI component file vendor\module-name\Ui\Component\Form\Field\DisableField Step: 2 Create etc/acl.xml Step: 3 view/adminhtml/ui_component/customer_form.xml Hope this article help you. Thank you</p>
<p>The post <a href="https://www.tagvibe.com/magento2-apply-acl-to-custom-field/">Magento2: Apply ACL to custom field</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-150">Magento 2 Admin ACL panel uses an authentication system and a robust system for creating Access Control List Rules (ACL), which allows a store owner to create fine-grained roles for each user in their system.</p>



<p class="gtfy-153">Magento 2 Access Control List Rules<br>The Magento 2 Admin ACL resources are visible under the Magento 2 admin System &gt; Permissions &gt; User Roles area. When we click on the Add New Role button or access a role.&nbsp; In Magento 2, we can apply the ACL rule in the menu or form, but this article will help you apply the ACL rule on specific filed in the form.</p>



<p class="gtfy-156">Step: 1</p>



<p class="gtfy-159">Create a UI component file <strong>vendor\module-name\Ui\Component\Form\Field\DisableField</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-162" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;?php


namespace vendor\module-name\Ui\Component\Form\Field;

use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Framework\View\Element\UiComponentInterface;
use Magento\Framework\AuthorizationInterface;
use Magento\Ui\Component\Form\Field as FormField;

/**
 * Class DisableField
 *
 * @package I95DevConnect\CloudCustomizations\Ui\Component\Form\Field
 * @author Rajat Kar
 */
class DisableField extends FormField
{
    /**
     * @var AuthorizationInterface
     */
    private $authorization;

    /**
     * Constructor
     *
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param AuthorizationInterface $authorization
     * @param UiComponentInterface[] $components
     * @param array $data
     */
    public function __construct(
        ContextInterface       $context,
        UiComponentFactory     $uiComponentFactory,
        AuthorizationInterface $authorization,
        array                  $components = [],
        array                  $data = []
    )
    {
        $this-&gt;authorization = $authorization;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }


    /**
     * Prepare component configuration
     *
     * @return void
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function prepare()
    {
        parent::prepare();


        $isAllowed = $this-&gt;authorization-&gt;isAllowed(‘Vendor_ModuleName:: editable_fields’);
        if (!$isAllowed) {
            $currentConfig = $this-&gt;getData(‘config’);
            $currentConfig[‘disabled’] = true;
            $this-&gt;setData(‘config’, $currentConfig);
        }
    }
}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">namespace</span><span style="color: #D8DEE9FF"> vendor</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">module</span><span style="color: #D8DEE9">-name\Ui\Component\Form\Field;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">use Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">View</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Element</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">UiComponent</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">ContextInterface</span><span style="color: #D8DEE9">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">use Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">View</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Element</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">UiComponentFactory</span><span style="color: #D8DEE9">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">use Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">View</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Element</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">UiComponentInterface</span><span style="color: #D8DEE9">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">use Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">AuthorizationInterface</span><span style="color: #D8DEE9">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">use Magento</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Ui</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Component</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Form</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Field as FormField</span><span style="color: #D8DEE9">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">/**</span></span>
<span class="line"><span style="color: #616E88"> * Class DisableField</span></span>
<span class="line"><span style="color: #616E88"> *</span></span>
<span class="line"><span style="color: #616E88"> * </span><span style="color: #81A1C1">@package</span><span style="color: #616E88"> I95DevConnect\CloudCustomizations\Ui\Component\Form\Field</span></span>
<span class="line"><span style="color: #616E88"> * </span><span style="color: #81A1C1">@author</span><span style="color: #616E88"> Rajat Kar</span></span>
<span class="line"><span style="color: #616E88"> */</span></span>
<span class="line"><span style="color: #D8DEE9FF">class DisableField extends FormField</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #616E88">/**</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@var</span><span style="color: #616E88"> </span><span style="color: #8FBCBB">AuthorizationInterface</span></span>
<span class="line"><span style="color: #616E88">     */</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">private</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">authorization</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #616E88">/**</span></span>
<span class="line"><span style="color: #616E88">     * Constructor</span></span>
<span class="line"><span style="color: #616E88">     *</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@param</span><span style="color: #616E88"> </span><span style="color: #8FBCBB">ContextInterface</span><span style="color: #616E88"> $context</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@param</span><span style="color: #616E88"> </span><span style="color: #8FBCBB">UiComponentFactory</span><span style="color: #616E88"> $uiComponentFactory</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@param</span><span style="color: #616E88"> </span><span style="color: #8FBCBB">AuthorizationInterface</span><span style="color: #616E88"> $authorization</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@param</span><span style="color: #616E88"> </span><span style="color: #8FBCBB">UiComponentInterface</span><span style="color: #81A1C1">[]</span><span style="color: #616E88"> $components</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@param</span><span style="color: #616E88"> </span><span style="color: #81A1C1">array</span><span style="color: #616E88"> $data</span></span>
<span class="line"><span style="color: #616E88">     */</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">__construct</span><span style="color: #ECEFF4">(</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #8FBCBB">ContextInterface</span><span style="color: #D8DEE9FF">       </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">context</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #8FBCBB">UiComponentFactory</span><span style="color: #D8DEE9FF">     </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">uiComponentFactory</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #8FBCBB">AuthorizationInterface</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">authorization</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">array</span><span style="color: #D8DEE9FF">                  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">components</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">[],</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">array</span><span style="color: #D8DEE9FF">                  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">[]</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">authorization</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">authorization</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">parent::</span><span style="color: #88C0D0">__construct</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">context</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">uiComponentFactory</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">components</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #616E88">/**</span></span>
<span class="line"><span style="color: #616E88">     * Prepare component configuration</span></span>
<span class="line"><span style="color: #616E88">     *</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@return</span><span style="color: #616E88"> </span><span style="color: #81A1C1">void</span></span>
<span class="line"><span style="color: #616E88">     * </span><span style="color: #81A1C1">@throws</span><span style="color: #616E88"> </span><span style="color: #ECEFF4">\</span><span style="color: #616E88">Magento</span><span style="color: #ECEFF4">\</span><span style="color: #616E88">Framework</span><span style="color: #ECEFF4">\</span><span style="color: #616E88">Exception</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">LocalizedException</span></span>
<span class="line"><span style="color: #616E88">     */</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">prepare</span><span style="color: #ECEFF4">()</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">parent::</span><span style="color: #88C0D0">prepare</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">isAllowed</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">authorization</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">isAllowed</span><span style="color: #ECEFF4">(</span><span style="color: #8FBCBB">‘Vendor_ModuleName</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF"> editable_fields’</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!$</span><span style="color: #D8DEE9">isAllowed</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">currentConfig</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">getData</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">‘config’</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">currentConfig</span><span style="color: #ECEFF4">[</span><span style="color: #D8DEE9FF">‘disabled’</span><span style="color: #ECEFF4">]</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">setData</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">‘config’</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">currentConfig</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="gtfy-165">Step: 2</p>



<p class="gtfy-168"><strong>Create etc/acl.xml</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-171" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;config xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd&quot;&gt;
    &lt;acl&gt;
        &lt;resources&gt;
            &lt;resource id=&quot;Magento_Backend::admin&quot;&gt;
                &lt;resource id=&quot;Magento_Customer::customer&quot;&gt;
                    &lt;resource id=&quot;Magento_Customer::manage&quot;&gt;
                        &lt;resource id=&quot;Vendor_ModuleName:: editable_fields&quot; title=&quot;allow edit some field&quot; translate=&quot;title&quot; sortOrder=&quot;110&quot; /&gt;
                    &lt;/resource&gt;
                &lt;/resource&gt;
            &lt;/resource&gt;
        &lt;/resources&gt;
    &lt;/acl&gt;
&lt;/config&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;config</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xmlns</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">xsi</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2001/XMLSchema-instance</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">noNamespaceSchemaLocation</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;acl&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;resources&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;resource</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">id</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Magento_Backend::admin</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;resource</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">id</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Magento_Customer::customer</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;resource</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">id</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Magento_Customer::manage</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;resource</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">id</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Vendor_ModuleName:: editable_fields</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">title</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">allow edit some field</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">translate</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">title</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">sortOrder</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">110</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/resource&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/resource&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/resource&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/resources&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/acl&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/config&gt;</span></span></code></pre></div>



<p class="gtfy-174">Step: 3</p>



<p class="gtfy-177"><strong>view/adminhtml/ui_component/customer_form.xml</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-180" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;form xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc/ui_configuration.xsd&quot;&gt;
    &lt;fieldset name=&quot;customer&quot;&gt;
        &lt;field name=&quot;customer_field_name&quot; formElement=&quot;input&quot; class=&quot;Vendor\ModuleName\Ui\Component\Form\Field\DisableField&quot;&gt;
            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;
                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;
                    &lt;item name=&quot;source&quot; xsi:type=&quot;string&quot;&gt;customer&lt;/item&gt;
                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;100&lt;/item&gt;
                    &lt;item name=&quot;visible&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;/item&gt;
                &lt;/item&gt;
            &lt;/argument&gt;
        &lt;/field&gt;
    &lt;/fieldset&gt;
&lt;/form&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;form</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xmlns</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">xsi</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2001/XMLSchema-instance</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">noNamespaceSchemaLocation</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">urn:magento:module:Magento_Ui:etc/ui_configuration.xsd</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;fieldset</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">customer</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;field</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">customer_field_name</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">formElement</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">input</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">class</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Vendor\ModuleName\Ui\Component\Form\Field\DisableField</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;argument</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">data</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">type</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">array</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;item</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">config</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">type</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">array</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;item</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">source</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">type</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">string</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">customer</span><span style="color: #81A1C1">&lt;/item&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;item</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">sortOrder</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">type</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">number</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">100</span><span style="color: #81A1C1">&lt;/item&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;item</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">name</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">visible</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">type</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">boolean</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">true</span><span style="color: #81A1C1">&lt;/item&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/item&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/argument&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/field&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/fieldset&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/form&gt;</span></span></code></pre></div>



<p class="gtfy-183">Hope this article help you. Thank you</p><p>The post <a href="https://www.tagvibe.com/magento2-apply-acl-to-custom-field/">Magento2: Apply ACL to custom field</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to set &#8216;if&#8217;, &#8216;else&#8217;, &#8216;and&#8217; conditions in knockout js Magento 2?</title>
		<link>https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Mon, 29 Nov 2021 20:23:47 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[conditional-statement]]></category>
		<category><![CDATA[ko]]></category>
		<category><![CDATA[ko-template]]></category>
		<guid isPermaLink="false">https://tagvibe.com/?p=186</guid>

					<description><![CDATA[<p>This post will give you the idea in certain ways to use if else, and condition in knockout JS in Magento 2 If else conditions in KO template If else conditions in KO template with &#38;&#38; operator</p>
<p>The post <a href="https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/">How to set ‘if’, ‘else’, ‘and’ conditions in knockout js Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-195">This post will give you the idea in certain ways to use if else, and condition in knockout JS in Magento 2</p>



<p class="gtfy-198"><strong>If else conditions in KO template</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-201" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;!-- ko if: myData --&gt;
..if statement goes here
&lt;!-- /ko --&gt;
&lt;!-- ko if: !(myData) --&gt;
..else statement goes here
&lt;!-- /ko --&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">myData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">..</span><span style="color: #D8DEE9">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">statement</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">goes</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">here</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9FF">(</span><span style="color: #D8DEE9">myData</span><span style="color: #D8DEE9FF">) </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">..</span><span style="color: #D8DEE9">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">statement</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">goes</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">here</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span></code></pre></div>



<p class="gtfy-204"><strong>If else conditions in KO template with <em>&amp;&amp;</em> operator</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-207" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;!-- ko if: X &amp;&amp; Y --&gt;
//your code
&lt;!-- /ko --&gt;

&lt;!-- ko if: X &amp;&amp; !Y --&gt;
//your code
&lt;!-- /ko --&gt;

&lt;!-- ko if: !X &amp;&amp; !Y --&gt;
 //your code
 &lt;!-- /ko --&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4"> </span><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span></code></pre></div><p>The post <a href="https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/">How to set ‘if’, ‘else’, ‘and’ conditions in knockout js Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hide Admin Menu Based on System Config in Magento 2</title>
		<link>https://www.tagvibe.com/hide-admin-menu-based-on-system-config-in-magento-2/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 17:27:43 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[hide-menu]]></category>
		<category><![CDATA[magento2]]></category>
		<category><![CDATA[system-config]]></category>
		<guid isPermaLink="false">https://tagvibe.com/?p=140</guid>

					<description><![CDATA[<p>Here, we will learn how to hide the admin menu based on the module enable and disable from system configuration. Follow the below steps to achieve this: Add the below code into your existing menu.xml File path: app\code\Vendor\Extension\etc\adminhtml\menu.xml let us know via the comment box if you need any help on this, we will be happy to solve it! Do share the article with your friends and stay updated with us.</p>
<p>The post <a href="https://www.tagvibe.com/hide-admin-menu-based-on-system-config-in-magento-2/">Hide Admin Menu Based on System Config in Magento 2</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-223">Here, we will learn how to hide the admin menu based on the module enable and disable from system configuration.</p>



<p class="gtfy-226">Follow the below steps to achieve this:</p>



<p class="gtfy-229">Add the below code into your existing menu.xml</p>



<p class="gtfy-232">File path: <em><strong>app\code\Vendor\Extension\etc\adminhtml\menu.xml</strong></em></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-235" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;?xml version=&quot;1.0&quot;?&gt;

&lt;config xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Backend:etc/menu.xsd&quot;&gt;
    &lt;menu&gt;
        &lt;add id=&quot;Vendor_Extension::extensionmenu&quot; title=&quot; Extension Menu&quot; module=&quot;Vendor_Extension&quot; sortOrder=&quot;10&quot; resource=&quot;Vendor_Extension::mainmenu&quot; dependsOnConfig=&quot;section/group/field&quot;/&gt;
    &lt;/menu&gt;
&lt;/config&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #5E81AC">xml</span><span style="color: #8FBCBB"> version</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1.0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;config</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xmlns</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">xsi</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2001/XMLSchema-instance</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">xsi</span><span style="color: #ECEFF4">:</span><span style="color: #8FBCBB">noNamespaceSchemaLocation</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">urn:magento:module:Magento_Backend:etc/menu.xsd</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;menu&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;add</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">id</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Vendor_Extension::extensionmenu</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">title</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> Extension Menu</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">module</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Vendor_Extension</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">sortOrder</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">10</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">resource</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Vendor_Extension::mainmenu</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">dependsOnConfig</span><span style="color: #D8DEE9FF">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">section/group/field</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/menu&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/config&gt;</span></span></code></pre></div>



<p class="gtfy-238">let us know via the comment box if you need any help on this, we will be happy to solve it! Do share the article with your friends and stay updated with us.</p><p>The post <a href="https://www.tagvibe.com/hide-admin-menu-based-on-system-config-in-magento-2/">Hide Admin Menu Based on System Config in Magento 2</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to remove unused core modules from Magento 2?</title>
		<link>https://www.tagvibe.com/how-to-remove-unused-core-modules-from-magento-2/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 19:11:42 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[composer replace]]></category>
		<category><![CDATA[magento core module]]></category>
		<category><![CDATA[remove core modules]]></category>
		<category><![CDATA[remove yotpo]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=131</guid>

					<description><![CDATA[<p>To reduce the load time sometimes we should to disable core modules for performance or security reasons. There, I sharing here the default way to disable a module: bin/magento module:disable Vendor_Module But in the above method below problem will be arise: Module will be disable but files are still there. If you run integration tests or static tests, it will run with including the disabled modules. So, we need a method to remove the module in a right way with the help of composer Remove module with composer As the core modules are loaded via composer as dependencies, we cannot simply remove them from the composer.json. we can remove those via replace capability. composer file looks like below with replace key &#8220;require&#8221;: { [&#8230;] }, &#8220;replace&#8221;: { &#160; &#160; &#160;&#8220;magento/module-marketplace&#8221;: &#8220;*&#8221; }, &#8220;config&#8221;: { [&#8230;] Example to remove core modules like dotmailer, vertex, yotpo&#160; below &#8220;replace&#8221;:{ &#160; &#160; &#160; &#8220;dotmailer/dotmailer-magento2-extension&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;dotmailer/dotmailer-magento2-extension-package&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;dotmailer/dotmailer-magento2-extension-enterprise&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;dotmailer/dotmailer-magento2-extension-chat&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;vertex/module-tax&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;vertex/sdk&#8221;: &#8220;*&#8221;, &#160; &#160; &#160; &#8220;vertex/module-address-validation&#8221;:&#8221;*&#8221;, &#160; &#160; &#160; &#8220;yotpo/magento2-module-yotpo-reviews&#8221; : &#8220;*&#8221; }, Then, run the &#8220;composer update&#8221; command to remove the core modules which is mentioned inside replace section.</p>
<p>The post <a href="https://www.tagvibe.com/how-to-remove-unused-core-modules-from-magento-2/">How to remove unused core modules from Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To reduce the load time sometimes we should to disable core modules for performance or security reasons. There, I sharing here the default way to disable a module:</p>
<p><span class="gtfy-239 gtfy-240" style="color: #008080;"><em>bin/magento module:disable Vendor_Module</em></span></p>
<p>But in the above method below problem will be arise:</p>
<ul>
<li>Module will be disable but files are still there.</li>
<li>If you run integration tests or static tests, it will run with including the disabled modules.<br />
So, we need a method to remove the module in a right way with the help of composer</li>
</ul>
<p>Remove module with composer</p>
<p>As the core modules are loaded via composer as dependencies, we cannot simply remove them from the composer.json. we can remove those via replace capability.</p>
<p>composer file looks like below with replace key</p>
<p><span style="color: #008080;"><em>&#8220;require&#8221;: {</em></span><br />
<span style="color: #008080;"><em>[&#8230;]</em></span><br />
<span style="color: #008080;"><em>},</em></span><br />
<span style="color: #008080;"><em>&#8220;replace&#8221;: {</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp;&#8220;magento/module-marketplace&#8221;: &#8220;*&#8221;</em></span><br />
<span style="color: #008080;"><em>},</em></span><br />
<span style="color: #008080;"><em>&#8220;config&#8221;: {</em></span><br />
<span style="color: #008080;"><em>[&#8230;]</em></span></p>
<p>Example to remove core modules like dotmailer, vertex, yotpo&nbsp; below</p>
<p><span style="color: #008080;"><em>&#8220;replace&#8221;:{</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;dotmailer/dotmailer-magento2-extension&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;dotmailer/dotmailer-magento2-extension-package&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;dotmailer/dotmailer-magento2-extension-enterprise&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;dotmailer/dotmailer-magento2-extension-chat&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;vertex/module-tax&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;vertex/sdk&#8221;: &#8220;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;vertex/module-address-validation&#8221;:&#8221;*&#8221;,</em></span><br />
<span style="color: #008080;"><em>&nbsp; &nbsp; &nbsp; &#8220;yotpo/magento2-module-yotpo-reviews&#8221; : &#8220;*&#8221;</em></span><br />
<span style="color: #008080;"><em>},</em></span></p>
<p>Then, run the &#8220;composer update&#8221; command to remove the core modules which is mentioned inside replace section.</p><p>The post <a href="https://www.tagvibe.com/how-to-remove-unused-core-modules-from-magento-2/">How to remove unused core modules from Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Magento 2 Useful Commands List for Developer</title>
		<link>https://www.tagvibe.com/magento-2-useful-commands-list-for-developer/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Sat, 17 Apr 2021 16:39:10 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=120</guid>

					<description><![CDATA[<p>Magento 2 Useful Commands List The list of most important  CLI commands for Magento 2 for developer . Setup Upgrade Using Command Line php bin/magento setup:upgrade or php bin/magento s:up &#160; If you don’t want to remove pub/static files while installing/updating database then use following command. php bin/magento setup:upgrade --keep-generated Cache Clean Using Command Line php bin/magento cache:clean  or php bin/magento c:c Cache Flush Using Command Line php bin/magento cache:flush or php bin/magento c:f View cache status Using Command Line php bin/magento cache:status or php bin/magento c:s Enable Cache Using Command Line php bin/magento cache:enable [cache_type] Disable Cache Using Command Line php bin/magento cache:disable [cache_type] Static Content Deploy Using Command Line (Use -f for force deploy on 2.2.x or later) php bin/magento setup:static-content:deploy -f or php bin/magento s:s:d -f Static Content Deploy For Particular Language Using Command Line php bin/magento setup:static-content:deploy en_US Static Content Deploy For Magento Backend Theme Using Command Line (Working on 2.1.1 or later) php bin/magento setup:static-content:deploy --theme="Magento/backend" Static Content Deploy For Specific Themes Using Command Line (Working on 2.1.1 or later) php bin/magento setup:static-content:deploy --theme Magento/luma --theme Magento/second_theme Exclude Themes on Static Content Deploy and does not minify HTML files Using Command Line (Working on 2.1.1 or later) php bin/magento setup:static-content:deploy en_US --exclude-theme Magento/luma --no-html-minify Reindexing Using Command Line php bin/magento indexer:reindex View the list of indexers Using Command Line php bin/magento indexer:info View indexer status Using Command Line php bin/magento indexer:status Show the mode of all indexers Using Command Line php bin/magento indexer:show-mode See all modules Status Using Command Line php bin/magento module:status Enable module Using Command Line php bin/magento module:enable Namespace_Module Disable module Using Command Line php bin/magento module:disable Namespace_Module Uninstall Module Using Command Line php bin/magento module:uninstall Namespace_Module Check Current Mode Using Command Line php bin/magento deploy:mode:show Change To Developer Mode Using Command Line php bin/magento deploy:mode:set developer Change To Production Mode Using Command Line php bin/magento deploy:mode:set production Run the single-tenant Compiler Using Command Line php bin/magento setup:di:compile or php bin/magento s:d:c Unlock Admin User Using Command Line php bin/magento admin:user:unlock adminusername Enable Maintenance Mode Using Command Line php bin/magento maintenance:enable To enable maintenance mode for all clients except 127.0.0.1 and 127.0.0.2: php bin/magento maintenance:enable --ip=191.0.0.1 --ip=191.0.0.2 To clear the list of IPs. php bin/magento maintenance:enable --ip=none Disable Maintenance Mode Using Command Line php bin/magento maintenance:disable Check Maintenance Mode Status Using Command Line php bin/magento maintenance:status Allow IP on Maintenance Mode Using Command Line php bin/magento maintenance:allow-ips --ip=191.0.0.1 --ip=191.0.0.2 Set Magento crontab Using Command Line php bin/magento cron:install --force Use &#8211;force to rewrite an existing Magento crontab.To view the crontab, enter the following command as the Magento file system owner. crontab -l Remove Magento crontab Using Command Line php bin/magento cron:remove</p>
<p>The post <a href="https://www.tagvibe.com/magento-2-useful-commands-list-for-developer/">Magento 2 Useful Commands List for Developer</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-452"><strong>Magento 2 Useful Commands List</strong></p>



<p class="gtfy-455">The list of most important  CLI commands for Magento 2 for developer .</p>



<p class="gtfy-458">Setup Upgrade Using Command Line</p>



<p class="gtfy-461"><code>php bin/magento setup:upgrade  or  php bin/magento s:up</code></p>



<p class="gtfy-464">&nbsp;</p>



<p class="gtfy-467">If you don’t want to remove pub/static files while installing/updating database then use following command.</p>



<p class="gtfy-470"><code>php bin/magento setup:upgrade --keep-generated</code></p>



<p class="gtfy-473">Cache Clean Using Command Line</p>



<p class="gtfy-476"><code>php bin/magento cache:clean  or php bin/magento c:c</code></p>



<p class="gtfy-479">Cache Flush Using Command Line</p>



<p class="gtfy-482">php bin/magento cache:flush or php bin/magento c:f</p>



<p class="gtfy-485">View cache status Using Command Line</p>



<p class="gtfy-488"><code>php bin/magento cache:status or php bin/magento c:s</code></p>



<p class="gtfy-491">Enable Cache Using Command Line</p>



<p class="gtfy-494"><code>php bin/magento cache:enable [cache_type]</code></p>



<p class="gtfy-497">Disable Cache Using Command Line</p>



<p class="gtfy-500"><code>php bin/magento cache:disable [cache_type]</code></p>



<p class="gtfy-503">Static Content Deploy Using Command Line (Use -f for force deploy on 2.2.x or later)</p>



<p class="gtfy-506"><code>php bin/magento setup:static-content:deploy -f or php bin/magento s:s:d -f</code></p>



<p class="gtfy-509">Static Content Deploy For Particular Language Using Command Line</p>



<p class="gtfy-512"><code>php bin/magento setup:static-content:deploy en_US</code></p>



<p class="gtfy-515">Static Content Deploy For Magento Backend Theme Using Command Line (Working on 2.1.1 or later)</p>



<p class="gtfy-518"><code>php bin/magento setup:static-content:deploy --theme="Magento/backend"</code></p>



<p class="gtfy-521">Static Content Deploy For Specific Themes Using Command Line (Working on 2.1.1 or later)</p>



<p class="gtfy-524"><code>php bin/magento setup:static-content:deploy --theme Magento/luma --theme Magento/second_theme</code></p>



<p class="gtfy-527">Exclude Themes on Static Content Deploy and does not minify HTML files Using Command Line (Working on 2.1.1 or later)</p>



<p class="gtfy-530"><code>php bin/magento setup:static-content:deploy en_US --exclude-theme Magento/luma --no-html-minify</code></p>



<p class="gtfy-533"><br />Reindexing Using Command Line</p>



<p class="gtfy-536"><code>php bin/magento indexer:reindex</code></p>



<p class="gtfy-539"><br />View the list of indexers Using Command Line</p>



<p class="gtfy-542"><code>php bin/magento indexer:info</code></p>



<p class="gtfy-545">View indexer status Using Command Line</p>



<p class="gtfy-548"><code>php bin/magento indexer:status</code></p>



<p class="gtfy-551">Show the mode of all indexers Using Command Line</p>



<p class="gtfy-554"><code>php bin/magento indexer:show-mode</code></p>



<p class="gtfy-557">See all modules Status Using Command Line</p>



<p class="gtfy-560"><code>php bin/magento module:status</code></p>



<p class="gtfy-563">Enable module Using Command Line</p>



<p class="gtfy-566"><code>php bin/magento module:enable Namespace_Module</code></p>



<p class="gtfy-569">Disable module Using Command Line</p>



<p class="gtfy-572"><code>php bin/magento module:disable Namespace_Module</code></p>



<p class="gtfy-575">Uninstall Module Using Command Line</p>



<p class="gtfy-578"><code>php bin/magento module:uninstall Namespace_Module</code></p>



<p class="gtfy-581">Check Current Mode Using Command Line</p>



<p class="gtfy-584"><code>php bin/magento deploy:mode:show</code></p>



<p class="gtfy-587">Change To Developer Mode Using Command Line</p>



<p class="gtfy-590"><code>php bin/magento deploy:mode:set developer</code></p>



<p class="gtfy-593">Change To Production Mode Using Command Line</p>



<p class="gtfy-596"><code>php bin/magento deploy:mode:set production</code></p>



<p class="gtfy-599">Run the single-tenant Compiler Using Command Line</p>



<p class="gtfy-602"><code>php bin/magento setup:di:compile</code> or <code>php bin/magento s:d:c</code></p>



<p class="gtfy-605">Unlock Admin User Using Command Line</p>



<p class="gtfy-608"><code>php bin/magento admin:user:unlock adminusername</code></p>



<p class="gtfy-611">Enable Maintenance Mode Using Command Line</p>



<p class="gtfy-614">php bin/magento maintenance:enable</p>



<p class="gtfy-617">To enable maintenance mode for all clients except 127.0.0.1 and 127.0.0.2:</p>



<p class="gtfy-620"><code>php bin/magento maintenance:enable --ip=191.0.0.1 --ip=191.0.0.2</code></p>



<p class="gtfy-623">To clear the list of IPs.</p>



<p class="gtfy-626"><code>php bin/magento maintenance:enable --ip=none</code></p>



<p class="gtfy-629">Disable Maintenance Mode Using Command Line</p>



<p class="gtfy-632"><code>php bin/magento maintenance:disable</code></p>



<p class="gtfy-635">Check Maintenance Mode Status Using Command Line</p>



<p class="gtfy-638"><code>php bin/magento maintenance:status</code></p>



<p class="gtfy-641">Allow IP on Maintenance Mode Using Command Line</p>



<p class="gtfy-644"><code>php bin/magento maintenance:allow-ips --ip=191.0.0.1 --ip=191.0.0.2</code></p>



<p class="gtfy-647">Set Magento crontab Using Command Line</p>



<p class="gtfy-650"><code>php bin/magento cron:install --force</code></p>



<p class="gtfy-653">Use &#8211;force to rewrite an existing Magento crontab.<br />To view the crontab, enter the following command as the Magento file system owner.</p>



<p class="gtfy-656"><code>crontab -l</code></p>



<p class="gtfy-659">Remove Magento crontab Using Command Line</p>



<p class="gtfy-662"><code>php bin/magento cron:remove</code></p><p>The post <a href="https://www.tagvibe.com/magento-2-useful-commands-list-for-developer/">Magento 2 Useful Commands List for Developer</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to debug Magento 2 issues?</title>
		<link>https://www.tagvibe.com/how-to-debug-magento-2-issues/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Wed, 30 Sep 2020 19:52:42 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[error-log]]></category>
		<category><![CDATA[js-issue]]></category>
		<category><![CDATA[knockou-js-debugging]]></category>
		<category><![CDATA[magento2]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=103</guid>

					<description><![CDATA[<p>First Step is to check&#160;./var/log&#160;directory in Magento 2 installation whether any errors or exceptions in logs, report or you can check the system.log, debug.log. If you Magento application is in default or production mode then you will see the &#160;‘There has been an error processing your request’&#160;message on page front, grab the report id from that message and check&#160;./var/report&#160;directory to get the exact error. If you want to see the error message directly in the browser , run php bin/magento deploy:mode:set developer command to switch to developer mode. 3rd step is to make sure that you have all the correct permission Use&#160;chown(change owner) and&#160;chmod&#160;(change mode) for you Magento files and folder. Check the web server logs. Nginx for var/log/nginx and &#160;for Apache it’s&#160;/var/log/apache2&#160;or&#160;/var/log/httpd. Clear Magento 2 cache files by running the php bin/magento cache:clean command. you can also add the belwo code in your index.php the ini_set(‘display_startup_errors’,1); ini_set(‘display_errors’,1); error_reporting(-1); Debug the Frontend JS issue Check browser console for the errors and resolve accordingly. If you are using any third party cache like varnish please clear the cache. Enable the template path hints by navigate to the Go to Admin Panel &#62; Stores &#62; Settings &#62; Configuration &#62; Advanced &#62; Developer &#62; Debug. to know the correct block and phtml file to debug in specific file. Debug the Knockout JS issue At first we need to get a Knockout instance from the browser console. var ko = require('knockout'); Now we have Knockout instance in the&#160;ko&#160;variable. We can use it to get a context of any DOM element. var context = ko.contextFor($0); where&#160;$0&#160;is a&#160;special variable&#160;in browser console. It contains a link to a DOM element that is last inspected. // Admin > Products > Catalog > Add Product // Inspect "Product Name" var fieldName = ko.contextFor($0).$data; console.log(fieldName.name); // product_form.product_form.product-details.container_name.name OR You can install this https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout debugger and debug. Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p>
<p>The post <a href="https://www.tagvibe.com/how-to-debug-magento-2-issues/">How to debug Magento 2 issues?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="wp-block-group gtfy-693"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list gtfy-690"><li>First Step is to check&nbsp;<em>./var/log&nbsp;</em>directory in Magento 2 installation whether any errors or exceptions in logs, report or you can check the <em>system.log</em>, debug.log.</li><li>If you Magento application is in default or production mode then you will see the &nbsp;‘<em>There has been an error processing your request’&nbsp;</em>message on page front, grab the report id from that message and check&nbsp;<em>./var/report</em>&nbsp;directory to get the exact error.</li><li>If you want to see the error message directly in the browser , run  <em>php bin/magento deploy:mode:set developer</em> command to switch to developer mode.</li><li>3rd step is to make sure that you have all the correct permission Use&nbsp;<em>chown</em>(change owner) and&nbsp;<em>chmod</em>&nbsp;(change mode) for you Magento files and folder.</li><li>Check the web server logs. Nginx for var/<strong>log</strong>/<strong>nginx</strong> and &nbsp;for Apache it’s&nbsp;<em>/var/log/apache2&nbsp;or&nbsp;/var/log/httpd</em>.</li><li>Clear Magento 2 cache files by running the php bin/magento cache:clean command.</li><li>you can also add the belwo code in your index.php<ul><li>the ini_set(‘display_startup_errors’,1);</li><li>ini_set(‘display_errors’,1);</li><li>error_reporting(-1);</li></ul></li></ul>



<p class="gtfy-691"><strong>Debug the Frontend JS issue</strong></p>



<ul class="wp-block-list gtfy-692"><li>Check browser console for the errors and resolve accordingly.</li><li>If you are using any third party cache like varnish please clear the cache.</li><li>Enable the template path hints by navigate to the Go to Admin Panel &gt; Stores &gt; Settings &gt; Configuration &gt; Advanced &gt; Developer &gt; Debug. to know the correct block and phtml file to debug in specific file.</li></ul>
</div></div>



<p class="gtfy-696"> <strong>Debug the Knockout JS issue</strong></p>



<ul class="wp-block-list gtfy-699"><li>At first we need to get a Knockout instance from the browser console.<ul><li><code>var ko = require('knockout'); </code></li></ul></li><li>Now we have Knockout instance in the&nbsp;<code>ko</code>&nbsp;variable. We can use it to get a context of any DOM element<strong>.</strong></li></ul>



<pre class="wp-block-preformatted gtfy-702"><code>var context = ko.contextFor($0);</code></pre>



<ul class="wp-block-list gtfy-705"><li>where&nbsp;<code>$0</code>&nbsp;is a&nbsp;<a href="https://developers.google.com/web/tools/chrome-devtools/debug/command-line/command-line-reference#section-1">special variable</a>&nbsp;in browser console. It contains a link to a DOM element that is last inspected.</li></ul>



<pre class="wp-block-preformatted gtfy-708"><code>// Admin > Products > Catalog > Add Product
// Inspect "Product Name"
var fieldName = ko.contextFor($0).$data;

console.log(fieldName.name); // product_form.product_form.product-details.container_name.name</code></pre>



<p class="gtfy-711">OR</p>



<p class="gtfy-714">You can install this <a href="https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout" target="_blank" rel="noreferrer noopener">https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout </a>debugger and debug.</p>



<p class="gtfy-717"><br>Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p><p>The post <a href="https://www.tagvibe.com/how-to-debug-magento-2-issues/">How to debug Magento 2 issues?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to fix the &#8220;AREA CODE NOT SET&#8221;  issue?</title>
		<link>https://www.tagvibe.com/how-to-fix-the-area-code-not-set-issue/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Sun, 06 Sep 2020 19:01:38 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[areacode]]></category>
		<category><![CDATA[magento2]]></category>
		<category><![CDATA[magentosession]]></category>
		<category><![CDATA[session]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=94</guid>

					<description><![CDATA[<p>Magento 2 Area code not set As a Magento developer we are facing lot of issue which is common while developing and customizing a module. Today we are going to discuss about How to fix the “Area code not set” issue. This error occurs mainly from four reason CRON, CLI , Setup Scripts and use of session in wrong area and it will pop up when you are either compiling or running setup upgrade command. In both of the cases, it tries to create an object using the constructor of your classes but couldn’t find the area code and it fails to load. WHAT IS AREA CODE IN MAGENTO 2? Magento uses area codes to define the entry point to application to load given a specific request context. There are seven distinct ‘areas’ of the system, each with their own area code: When setting the session for customer or Order we should define the area. It’s Fixed related to this : For Example: We are creating a plugin or overriding a method of core class in custom class and we have injected Magento core session manager and customer session in custom class constructor. For overriding the existing core class method we are using preference in di.xml and keep in global onside our custom module. when we run complile and upgrade we will get &#8220;AREA CODE NOT SET&#8221; issue. Solution: To resolve this issue we should keep the di.xml in frontend area as we are using customer session in our class. Likewise if you are using Magento Backend session in your custom class you should keep the di.xml in adminhtml area. Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p>
<p>The post <a href="https://www.tagvibe.com/how-to-fix-the-area-code-not-set-issue/">How to fix the “AREA CODE NOT SET”  issue?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-756"><strong>Magento 2 Area code not set</strong></p>



<p class="gtfy-759">As a Magento developer we are facing lot of issue which is common while developing and customizing a module. Today we are going to discuss about  How to fix the  “Area code not set” issue. This error occurs mainly from four reason CRON, CLI , Setup Scripts and use of session in wrong area and it will pop up when you are either compiling or running setup upgrade command. In both of the cases, it tries to create an object using the constructor of your classes but couldn’t find the area code and it fails to load.</p>



<p class="gtfy-762"><strong>WHAT IS AREA CODE IN MAGENTO 2?</strong></p>



<p class="gtfy-765">Magento uses area codes to define the entry point to application to load given a specific request context. There are seven distinct ‘areas’ of the system, each with their own area code:</p>



<ol class="wp-block-list gtfy-775">
<li class="gtfy-768 gutenify-list-item">global</li>



<li class="gtfy-769 gutenify-list-item">doc</li>



<li class="gtfy-770 gutenify-list-item">crontab</li>



<li class="gtfy-771 gutenify-list-item">frontend</li>



<li class="gtfy-772 gutenify-list-item">adminhtml</li>



<li class="gtfy-773 gutenify-list-item">webapi_rest</li>



<li class="gtfy-774 gutenify-list-item">webapi_soap</li>
</ol>



<p class="gtfy-778">When setting the session for customer or Order we should define the area.</p>



<p class="gtfy-781"><strong>It’s Fixed related to this :</strong></p>



<ol class="wp-block-list gtfy-792">
<li class="gtfy-784 gutenify-list-item">Magento 2.2 area code not set: area code must be set before starting a session.</li>



<li class="gtfy-785 gutenify-list-item">upgrading data.. area code not set: area code must be set before starting a session.</li>



<li class="gtfy-786 gutenify-list-item">Magento 2 setup upgrade import failed: area code is not set</li>



<li class="gtfy-787 gutenify-list-item">import failed: area code not set: area code must be set before starting a session.</li>



<li class="gtfy-788 gutenify-list-item">Magento 2 area code admin does not exist</li>



<li class="gtfy-789 gutenify-list-item">processing configurations data from configuration file… import failed: area code is not set</li>



<li class="gtfy-790 gutenify-list-item">import failed: area code is not set magento2</li>



<li class="gtfy-791 gutenify-list-item">area code “” does not exist Magento 2</li>
</ol>



<p class="gtfy-795"><em><strong>For Example:</strong></em></p>



<p class="gtfy-798">We are creating a plugin or overriding a method of core class in custom class and we have injected Magento core session manager and customer session in custom class constructor.</p>



<p class="gtfy-801">For overriding the existing core class method we are using preference in di.xml and keep in global onside our custom module. when we run complile and upgrade we will get &#8220;AREA CODE NOT SET&#8221; issue.</p>



<p class="gtfy-804"><strong>Solution</strong>:</p>



<p class="gtfy-807">To resolve this issue we should keep the di.xml in frontend area as we are using customer session in our class. Likewise if you are using Magento Backend session in your custom class you should keep the di.xml in adminhtml area.</p>



<p class="gtfy-810">Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p><p>The post <a href="https://www.tagvibe.com/how-to-fix-the-area-code-not-set-issue/">How to fix the “AREA CODE NOT SET”  issue?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to change customer password quickly in Magento 2</title>
		<link>https://www.tagvibe.com/how-to-change-customer-password-quickly-in-magento-2/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Sat, 15 Aug 2020 18:32:49 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[change-password]]></category>
		<category><![CDATA[customer]]></category>
		<category><![CDATA[easy-change-password]]></category>
		<category><![CDATA[magento2]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=87</guid>

					<description><![CDATA[<p>In Magento 1 from admin under Manage Customer section we can update/change the customer new password easily but when it comes to Magento 2 that option removed by Magento.As we are migrating customer from Magento 1 to Magento 2 or want to change password of existing customer For an easy way to change the password for bulk of customer in Magento 2, you can import customer CSV file data of existing customer email id and password field. You can give your password which you want to change and&#160;password_hash&#160;should be blank. Please refer the below sceenshots:</p>
<p>The post <a href="https://www.tagvibe.com/how-to-change-customer-password-quickly-in-magento-2/">How to change customer password quickly in Magento 2</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-825">In Magento 1 from admin under Manage Customer section we can update/change the customer new password easily but when it comes to Magento 2 that option removed by Magento.As we are migrating customer from Magento 1 to Magento 2 or want to change password of existing customer</p>



<p class="gtfy-828">For an easy way to change the password for bulk of customer in Magento 2, you can import customer CSV file data of existing customer email id and password field. You can give your password which you want to change and&nbsp;<strong>password_hash</strong>&nbsp;should be blank.</p>



<p class="gtfy-831">Please refer the below sceenshots:</p>



<figure class="wp-block-image size-large gtfy-834"><img decoding="async" src="http://tagvibe.com/wp-content/uploads/2020/08/magento_2password_change-1024x543.jpg" alt="" class="wp-image-88"/><figcaption class="wp-element-caption">Magento 2 customer passowrd import CSV</figcaption></figure>



<figure class="wp-block-image size-large gtfy-837"><img decoding="async" src="http://tagvibe.com/wp-content/uploads/2020/08/magento2_customer_password-1024x505.jpg" alt="" class="wp-image-89"/><figcaption class="wp-element-caption">Magento2 customer import screen to change password</figcaption></figure>



<p class="gtfy-840"></p><p>The post <a href="https://www.tagvibe.com/how-to-change-customer-password-quickly-in-magento-2/">How to change customer password quickly in Magento 2</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
