<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tu Nguyen</title>
    <description>The latest articles on DEV Community by Tu Nguyen (@mrtuvn).</description>
    <link>https://dev.to/mrtuvn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F326239%2Fad555e27-5f16-4083-8152-ab8e0b5f34e7.jpeg</url>
      <title>DEV Community: Tu Nguyen</title>
      <link>https://dev.to/mrtuvn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrtuvn"/>
    <language>en</language>
    <item>
      <title>Magento2 ui component in deep</title>
      <dc:creator>Tu Nguyen</dc:creator>
      <pubDate>Mon, 03 Feb 2020 11:04:52 +0000</pubDate>
      <link>https://dev.to/mrtuvn/magento2-ui-component-in-deep-onj</link>
      <guid>https://dev.to/mrtuvn/magento2-ui-component-in-deep-onj</guid>
      <description>&lt;p&gt;From this tutorial i will show you how to get info from some main component in magento 2 by javascript&lt;/p&gt;

&lt;p&gt;All components defined in below file&lt;br&gt;
&lt;a href="https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml"&gt;https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work with components in magento you possible may related with uiregistry. This is ultility component allow you access to specific component. &lt;/p&gt;

&lt;p&gt;Playground for work with component from browser&lt;/p&gt;

&lt;p&gt;Go to product list page of magento in admin dashboard&lt;br&gt;
Open chrome browser &amp;gt; Console tab&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;requirejs('uiRegistry').get('%componentName%');&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;componentName is string name of component.&lt;/p&gt;

&lt;h1&gt;
  
  
  1 Listing component
&lt;/h1&gt;

&lt;p&gt;Source file&lt;br&gt;
&lt;a href="https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/grid/listing.js"&gt;https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/grid/listing.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is alot place magento use this component such as: Product listing, Order listing, cms page listing&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;var productrows = requirejs('uiRegistry').get('product_listing.product_listing.product_columns').rows&lt;/p&gt;

&lt;p&gt;Above will return current object contain rows of products&lt;/p&gt;

&lt;p&gt;[{product1},{product2},so on]&lt;/p&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;var productrows = requirejs('uiRegistry').get('product_listing.product_listing_data_source').data['items']&lt;/p&gt;

&lt;p&gt;var components = requirejs('uiRegistry').get('product_listing.product_listing.product_columns').elems()&lt;/p&gt;

&lt;h1&gt;
  
  
  2 Form component
&lt;/h1&gt;

&lt;p&gt;Source file &lt;br&gt;
&lt;a href="https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/form/form.js"&gt;https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/form/form.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Continuing...&lt;/p&gt;

</description>
      <category>magento2</category>
      <category>uicomponent</category>
      <category>knockoutjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Remove crapware unused magento 2 extensions</title>
      <dc:creator>Tu Nguyen</dc:creator>
      <pubDate>Sat, 01 Feb 2020 03:20:10 +0000</pubDate>
      <link>https://dev.to/mrtuvn/remove-crapware-unused-magento-2-extensions-4ke6</link>
      <guid>https://dev.to/mrtuvn/remove-crapware-unused-magento-2-extensions-4ke6</guid>
      <description>&lt;p&gt;Yeah magento should focus in main core modules good for business and avoid bundle crap things&lt;/p&gt;

&lt;p&gt;From my perspective i don't need unused modules&lt;br&gt;
Here is the guide to allow you remove module from your magento 2 project based on composer&lt;/p&gt;

&lt;p&gt;The Approach&lt;br&gt;
It’s preferred to remove modules via composer. Add a block as follows to your composer.json file:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update 2.3.4+&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="highlight xml"&gt;&lt;code&gt;
"replace": {
        "magento/module-authorizenet": "*",
        "magento/module-google-adwords": "*",
        "magento/module-send-friend": "*",
        "magento/module-signifyd": "*",
        "magento/module-bundle-graph-ql": "*",
        "magento/module-catalog-graph-ql": "*",
        "magento/module-catalog-inventory-graph-ql": "*",
        "magento/module-catalog-url-rewrite-graph-ql": "*",
        "magento/module-cms-graph-ql": "*",
        "magento/module-cms-url-rewrite-graph-ql": "*",
        "magento/module-inventory-graph-ql": "*",
        "magento/module-configurable-product-graph-ql": "*",
        "magento/module-customer-graph-ql": "*",
        "magento/module-downloadable-graph-ql": "*",
        "magento/module-eav-graph-ql": "*",
        "magento/module-graph-ql": "*",
        "magento/module-grouped-product-graph-ql": "*",
        "magento/module-quote-graph-ql": "*",
        "magento/module-store-graph-ql": "*",
        "magento/module-swatches-graph-ql": "*",
        "magento/module-tax-graph-ql": "*",
        "magento/module-url-rewrite-graph-ql": "*",
        "magento/module-weee-graph-ql": "*",
        "temando/module-shipping-m2": "*",
        "dotmailer/dotmailer-magento2-extension": "*",
        "klarna/module-kp": "*",
        "klarna/module-ordermanagement": "*",
        "klarna/module-core": "*",
        "amzn/amazon-pay-sdk-php": "*",
        "amzn/amazon-pay-and-login-with-amazon-core-module": "*",
        "amzn/login-with-amazon-module": "*",
        "amzn/amazon-pay-module": "*",
        "vertex/module-tax": "*",
        "vertex/sdk": "*",
        "yotpo/magento2-module-yotpo-reviews": "*"
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Update 2.2.0+&lt;/strong&gt;&lt;br&gt;
Updating...&lt;/p&gt;

&lt;p&gt;After modify composer.json&lt;br&gt;
Run composer update&lt;/p&gt;

&lt;p&gt;Run setup:upgrade&lt;/p&gt;

&lt;p&gt;then run some basic magento commands like compilation or flush caches&lt;/p&gt;

</description>
      <category>magento2</category>
      <category>webdev</category>
      <category>hack</category>
    </item>
    <item>
      <title>Send email in magento 2.3 and beyond</title>
      <dc:creator>Tu Nguyen</dc:creator>
      <pubDate>Fri, 31 Jan 2020 02:00:16 +0000</pubDate>
      <link>https://dev.to/mrtuvn/send-email-in-magento-2-3-and-beyond-1oh</link>
      <guid>https://dev.to/mrtuvn/send-email-in-magento-2-3-and-beyond-1oh</guid>
      <description>&lt;p&gt;First you need inject class TransportBuilder default to your constructor&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;\Magento\Framework\Mail\Template\TransportBuilder&lt;/p&gt;
&lt;/blockquote&gt;

&lt;pre class="highlight php"&gt;
&lt;code&gt;
            $this-&amp;gt;_transportBuilder-&amp;gt;setTemplateIdentifier(
                $this-&amp;gt;_scopeConfig-&amp;gt;getValue(
                    self::XML_PATH_ERROR_TEMPLATE,
                    \Magento\Store\Model\ScopeInterface::SCOPE_STORE
                )
            )-&amp;gt;setTemplateOptions(
                [
                    'area' =&amp;gt; \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE,
                    'store' =&amp;gt; \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                ]
            )-&amp;gt;setTemplateVars(
                ['warnings' =&amp;gt; join("\n", $importWarnings)]
            )-&amp;gt;setFrom(
                $this-&amp;gt;_scopeConfig-&amp;gt;getValue(
                    self::XML_PATH_ERROR_IDENTITY,
                    \Magento\Store\Model\ScopeInterface::SCOPE_STORE
                )
            )-&amp;gt;addTo($errorRecipient);
            $transport = $this-&amp;gt;_transportBuilder-&amp;gt;getTransport();
            $transport-&amp;gt;sendMessage();
&lt;/code&gt;
&lt;/pre&gt;

</description>
      <category>magento2</category>
      <category>email</category>
      <category>backend</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
