Minicart - Html text showing raw , required formatted text in magento 2Magento 2 Open minicart when item is addedMagento : Quick View Add to Cart not Showing Product in Minicart Witout Refreshing PageMagento 2 minicart showing count multiple timeMagento 2, minicart, change “Go to Checkout” text to “Checkout” onlyUpdate Minicart programatically in magento 2Magento 2: Customer logout after minicart showing product.Decode HTML Knockout JS - MinicartMagento 2 I Want to add Dropdown Quantity Box In Minicartmove minicart before top.search magento 2.2Minicart - Html text reflecting raw , required formatted text in magento 2

Pushout commutative diagram

4*4*4 Rubiks cube Top Layer Issue

Turing patterns

Required to check-in in person at international layover airport

Does there exist a word to express a male who behaves as a female?

Smooth switching between 12v batteries, with toggle switch

Do any instruments not produce overtones?

Why does the Schrödinger equation work so well for the Hydrogen atom despite the relativistic boundary at the nucleus?

Trapping Rain Water

PL/SQL function to receive a number and return its binary format

Why is the relationship between frequency and pitch exponential?

How is it possible that Gollum speaks Westron?

Why is the past conditionel used here?

Efficient integer floor function in C++

How hard would it be to convert a glider into an powered electric aircraft?

My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?

Version 2 - print new even-length arrays from two arrays

When writing an error prompt, should we end the sentence with a exclamation mark or a dot?

Did the first version of Linux developed by Linus Torvalds have a GUI?

Do the English have an ancient (obsolete) verb for the action of the book opening?

Why don't B747s start takeoffs with full throttle?

Select items in a list that contain criteria #2

What are the words for people who cause trouble believing they know better?

What LISP compilers and interpreters were available for 8-bit machines?



Minicart - Html text showing raw , required formatted text in magento 2


Magento 2 Open minicart when item is addedMagento : Quick View Add to Cart not Showing Product in Minicart Witout Refreshing PageMagento 2 minicart showing count multiple timeMagento 2, minicart, change “Go to Checkout” text to “Checkout” onlyUpdate Minicart programatically in magento 2Magento 2: Customer logout after minicart showing product.Decode HTML Knockout JS - MinicartMagento 2 I Want to add Dropdown Quantity Box In Minicartmove minicart before top.search magento 2.2Minicart - Html text reflecting raw , required formatted text in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.



Using Magento 2.2.4.



I expect html formatted text but the actual output raw text on minicart



Detail Page



minicart










share|improve this question







New contributor



Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.



    Using Magento 2.2.4.



    I expect html formatted text but the actual output raw text on minicart



    Detail Page



    minicart










    share|improve this question







    New contributor



    Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      0












      0








      0








      In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.



      Using Magento 2.2.4.



      I expect html formatted text but the actual output raw text on minicart



      Detail Page



      minicart










      share|improve this question







      New contributor



      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.



      Using Magento 2.2.4.



      I expect html formatted text but the actual output raw text on minicart



      Detail Page



      minicart







      magento2 mini-cart






      share|improve this question







      New contributor



      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked May 28 at 16:29









      Rishabh ShuklaRishabh Shukla

      1




      1




      New contributor



      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Rishabh Shukla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Try following way:




          app/code/SR/MagentoCommunity/etc/di.xml




          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoCheckoutCustomerDataDefaultItem">
          <plugin name="sr_DefaultItem"
          type="SRMagentoCommunityPluginCheckoutCustomerDataDefaultItem" sortOrder="1"/>
          </type>
          </config>



          app/code/SR/MagentoCommunity/Plugin/Checkout/CustomerData/DefaultItem.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutCustomerData;


          class DefaultItem

          public function afterGetItemData(
          MagentoCheckoutCustomerDataDefaultItem $subject,
          $item
          )

          if (isset($item['options']))
          $options = $item['options'];
          foreach ($options as $key => $option)
          $item['options'][$key]['value'] = html_entity_decode($option['value']);



          return $item;




          Overwrite following template for change render type:




          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html




          Now modify



          <span data-bind="text: option.value"></span>


          to



          <span data-bind="html: option.value"></span>


          Output:
          enter image description here



          [Update]



          Add following code in di.xml



          <type name="MagentoCheckoutModelDefaultConfigProvider">
          <plugin name="st_config_provider"
          type="SRMagentoCommunityPluginCheckoutModelDefaultConfigProvider" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Checkout/Model/DefaultConfigProvider.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutModel;

          use MagentoFrameworkSerializeSerializerJson;

          class DefaultConfigProvider

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGetConfig(
          MagentoCheckoutModelDefaultConfigProvider $subject,
          array $result
          )

          $items = $result['totalsData']['items'];
          foreach ($items as $index => $item)
          if (isset($item['options']))
          $options = $this->json->unserialize($item['options']);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item['options'] = $this->json->serialize($options);
          $result['totalsData']['items'][$index] = $item;



          return $result;




          OR



          Add following code in di.xml



          <type name="MagentoQuoteModelCartCartTotalRepository">
          <plugin name="checkout_item_sidebar"
          type="SRMagentoCommunityPluginQuoteModelCartCartTotalRepository" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Quote/Model/Cart/CartTotalRepository.php




          <?php
          namespace SRMagentoCommunityPluginQuoteModelCart;

          use MagentoFrameworkSerializeSerializerJson;

          class CartTotalRepository

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGet(
          MagentoQuoteModelCartCartTotalRepository $subject,
          $quoteTotals
          )
          $quoteItems = $quoteTotals->getItems();
          $items = [];

          /** @var MagentoQuoteModelCartTotalsItem $item */
          foreach ($quoteItems as $index => $item)
          if ($options = $item->getOptions())
          $options = $this->json->unserialize($options);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item->setOptions($this->json->serialize($options));

          $items[$index] = $item;


          $quoteTotals->setItems($items);
          return $quoteTotals;







          share|improve this answer

























          • Now it's working on minicart, but still not working checkout page.

            – Rishabh Shukla
            May 28 at 19:34











          • Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

            – Sohel Rana
            May 28 at 21:49











          • Please mention checkout page method for plugin.

            – Rishabh Shukla
            May 29 at 5:47












          • Check updated answer

            – Sohel Rana
            May 29 at 7:36











          • Is it working for you? If yes, accept this answer that will help other.

            – Sohel Rana
            May 30 at 6:35











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Rishabh Shukla is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f276447%2fminicart-html-text-showing-raw-required-formatted-text-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Try following way:




          app/code/SR/MagentoCommunity/etc/di.xml




          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoCheckoutCustomerDataDefaultItem">
          <plugin name="sr_DefaultItem"
          type="SRMagentoCommunityPluginCheckoutCustomerDataDefaultItem" sortOrder="1"/>
          </type>
          </config>



          app/code/SR/MagentoCommunity/Plugin/Checkout/CustomerData/DefaultItem.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutCustomerData;


          class DefaultItem

          public function afterGetItemData(
          MagentoCheckoutCustomerDataDefaultItem $subject,
          $item
          )

          if (isset($item['options']))
          $options = $item['options'];
          foreach ($options as $key => $option)
          $item['options'][$key]['value'] = html_entity_decode($option['value']);



          return $item;




          Overwrite following template for change render type:




          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html




          Now modify



          <span data-bind="text: option.value"></span>


          to



          <span data-bind="html: option.value"></span>


          Output:
          enter image description here



          [Update]



          Add following code in di.xml



          <type name="MagentoCheckoutModelDefaultConfigProvider">
          <plugin name="st_config_provider"
          type="SRMagentoCommunityPluginCheckoutModelDefaultConfigProvider" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Checkout/Model/DefaultConfigProvider.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutModel;

          use MagentoFrameworkSerializeSerializerJson;

          class DefaultConfigProvider

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGetConfig(
          MagentoCheckoutModelDefaultConfigProvider $subject,
          array $result
          )

          $items = $result['totalsData']['items'];
          foreach ($items as $index => $item)
          if (isset($item['options']))
          $options = $this->json->unserialize($item['options']);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item['options'] = $this->json->serialize($options);
          $result['totalsData']['items'][$index] = $item;



          return $result;




          OR



          Add following code in di.xml



          <type name="MagentoQuoteModelCartCartTotalRepository">
          <plugin name="checkout_item_sidebar"
          type="SRMagentoCommunityPluginQuoteModelCartCartTotalRepository" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Quote/Model/Cart/CartTotalRepository.php




          <?php
          namespace SRMagentoCommunityPluginQuoteModelCart;

          use MagentoFrameworkSerializeSerializerJson;

          class CartTotalRepository

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGet(
          MagentoQuoteModelCartCartTotalRepository $subject,
          $quoteTotals
          )
          $quoteItems = $quoteTotals->getItems();
          $items = [];

          /** @var MagentoQuoteModelCartTotalsItem $item */
          foreach ($quoteItems as $index => $item)
          if ($options = $item->getOptions())
          $options = $this->json->unserialize($options);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item->setOptions($this->json->serialize($options));

          $items[$index] = $item;


          $quoteTotals->setItems($items);
          return $quoteTotals;







          share|improve this answer

























          • Now it's working on minicart, but still not working checkout page.

            – Rishabh Shukla
            May 28 at 19:34











          • Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

            – Sohel Rana
            May 28 at 21:49











          • Please mention checkout page method for plugin.

            – Rishabh Shukla
            May 29 at 5:47












          • Check updated answer

            – Sohel Rana
            May 29 at 7:36











          • Is it working for you? If yes, accept this answer that will help other.

            – Sohel Rana
            May 30 at 6:35















          0














          Try following way:




          app/code/SR/MagentoCommunity/etc/di.xml




          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoCheckoutCustomerDataDefaultItem">
          <plugin name="sr_DefaultItem"
          type="SRMagentoCommunityPluginCheckoutCustomerDataDefaultItem" sortOrder="1"/>
          </type>
          </config>



          app/code/SR/MagentoCommunity/Plugin/Checkout/CustomerData/DefaultItem.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutCustomerData;


          class DefaultItem

          public function afterGetItemData(
          MagentoCheckoutCustomerDataDefaultItem $subject,
          $item
          )

          if (isset($item['options']))
          $options = $item['options'];
          foreach ($options as $key => $option)
          $item['options'][$key]['value'] = html_entity_decode($option['value']);



          return $item;




          Overwrite following template for change render type:




          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html




          Now modify



          <span data-bind="text: option.value"></span>


          to



          <span data-bind="html: option.value"></span>


          Output:
          enter image description here



          [Update]



          Add following code in di.xml



          <type name="MagentoCheckoutModelDefaultConfigProvider">
          <plugin name="st_config_provider"
          type="SRMagentoCommunityPluginCheckoutModelDefaultConfigProvider" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Checkout/Model/DefaultConfigProvider.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutModel;

          use MagentoFrameworkSerializeSerializerJson;

          class DefaultConfigProvider

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGetConfig(
          MagentoCheckoutModelDefaultConfigProvider $subject,
          array $result
          )

          $items = $result['totalsData']['items'];
          foreach ($items as $index => $item)
          if (isset($item['options']))
          $options = $this->json->unserialize($item['options']);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item['options'] = $this->json->serialize($options);
          $result['totalsData']['items'][$index] = $item;



          return $result;




          OR



          Add following code in di.xml



          <type name="MagentoQuoteModelCartCartTotalRepository">
          <plugin name="checkout_item_sidebar"
          type="SRMagentoCommunityPluginQuoteModelCartCartTotalRepository" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Quote/Model/Cart/CartTotalRepository.php




          <?php
          namespace SRMagentoCommunityPluginQuoteModelCart;

          use MagentoFrameworkSerializeSerializerJson;

          class CartTotalRepository

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGet(
          MagentoQuoteModelCartCartTotalRepository $subject,
          $quoteTotals
          )
          $quoteItems = $quoteTotals->getItems();
          $items = [];

          /** @var MagentoQuoteModelCartTotalsItem $item */
          foreach ($quoteItems as $index => $item)
          if ($options = $item->getOptions())
          $options = $this->json->unserialize($options);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item->setOptions($this->json->serialize($options));

          $items[$index] = $item;


          $quoteTotals->setItems($items);
          return $quoteTotals;







          share|improve this answer

























          • Now it's working on minicart, but still not working checkout page.

            – Rishabh Shukla
            May 28 at 19:34











          • Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

            – Sohel Rana
            May 28 at 21:49











          • Please mention checkout page method for plugin.

            – Rishabh Shukla
            May 29 at 5:47












          • Check updated answer

            – Sohel Rana
            May 29 at 7:36











          • Is it working for you? If yes, accept this answer that will help other.

            – Sohel Rana
            May 30 at 6:35













          0












          0








          0







          Try following way:




          app/code/SR/MagentoCommunity/etc/di.xml




          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoCheckoutCustomerDataDefaultItem">
          <plugin name="sr_DefaultItem"
          type="SRMagentoCommunityPluginCheckoutCustomerDataDefaultItem" sortOrder="1"/>
          </type>
          </config>



          app/code/SR/MagentoCommunity/Plugin/Checkout/CustomerData/DefaultItem.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutCustomerData;


          class DefaultItem

          public function afterGetItemData(
          MagentoCheckoutCustomerDataDefaultItem $subject,
          $item
          )

          if (isset($item['options']))
          $options = $item['options'];
          foreach ($options as $key => $option)
          $item['options'][$key]['value'] = html_entity_decode($option['value']);



          return $item;




          Overwrite following template for change render type:




          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html




          Now modify



          <span data-bind="text: option.value"></span>


          to



          <span data-bind="html: option.value"></span>


          Output:
          enter image description here



          [Update]



          Add following code in di.xml



          <type name="MagentoCheckoutModelDefaultConfigProvider">
          <plugin name="st_config_provider"
          type="SRMagentoCommunityPluginCheckoutModelDefaultConfigProvider" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Checkout/Model/DefaultConfigProvider.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutModel;

          use MagentoFrameworkSerializeSerializerJson;

          class DefaultConfigProvider

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGetConfig(
          MagentoCheckoutModelDefaultConfigProvider $subject,
          array $result
          )

          $items = $result['totalsData']['items'];
          foreach ($items as $index => $item)
          if (isset($item['options']))
          $options = $this->json->unserialize($item['options']);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item['options'] = $this->json->serialize($options);
          $result['totalsData']['items'][$index] = $item;



          return $result;




          OR



          Add following code in di.xml



          <type name="MagentoQuoteModelCartCartTotalRepository">
          <plugin name="checkout_item_sidebar"
          type="SRMagentoCommunityPluginQuoteModelCartCartTotalRepository" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Quote/Model/Cart/CartTotalRepository.php




          <?php
          namespace SRMagentoCommunityPluginQuoteModelCart;

          use MagentoFrameworkSerializeSerializerJson;

          class CartTotalRepository

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGet(
          MagentoQuoteModelCartCartTotalRepository $subject,
          $quoteTotals
          )
          $quoteItems = $quoteTotals->getItems();
          $items = [];

          /** @var MagentoQuoteModelCartTotalsItem $item */
          foreach ($quoteItems as $index => $item)
          if ($options = $item->getOptions())
          $options = $this->json->unserialize($options);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item->setOptions($this->json->serialize($options));

          $items[$index] = $item;


          $quoteTotals->setItems($items);
          return $quoteTotals;







          share|improve this answer















          Try following way:




          app/code/SR/MagentoCommunity/etc/di.xml




          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoCheckoutCustomerDataDefaultItem">
          <plugin name="sr_DefaultItem"
          type="SRMagentoCommunityPluginCheckoutCustomerDataDefaultItem" sortOrder="1"/>
          </type>
          </config>



          app/code/SR/MagentoCommunity/Plugin/Checkout/CustomerData/DefaultItem.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutCustomerData;


          class DefaultItem

          public function afterGetItemData(
          MagentoCheckoutCustomerDataDefaultItem $subject,
          $item
          )

          if (isset($item['options']))
          $options = $item['options'];
          foreach ($options as $key => $option)
          $item['options'][$key]['value'] = html_entity_decode($option['value']);



          return $item;




          Overwrite following template for change render type:




          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html




          Now modify



          <span data-bind="text: option.value"></span>


          to



          <span data-bind="html: option.value"></span>


          Output:
          enter image description here



          [Update]



          Add following code in di.xml



          <type name="MagentoCheckoutModelDefaultConfigProvider">
          <plugin name="st_config_provider"
          type="SRMagentoCommunityPluginCheckoutModelDefaultConfigProvider" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Checkout/Model/DefaultConfigProvider.php




          <?php
          namespace SRMagentoCommunityPluginCheckoutModel;

          use MagentoFrameworkSerializeSerializerJson;

          class DefaultConfigProvider

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGetConfig(
          MagentoCheckoutModelDefaultConfigProvider $subject,
          array $result
          )

          $items = $result['totalsData']['items'];
          foreach ($items as $index => $item)
          if (isset($item['options']))
          $options = $this->json->unserialize($item['options']);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item['options'] = $this->json->serialize($options);
          $result['totalsData']['items'][$index] = $item;



          return $result;




          OR



          Add following code in di.xml



          <type name="MagentoQuoteModelCartCartTotalRepository">
          <plugin name="checkout_item_sidebar"
          type="SRMagentoCommunityPluginQuoteModelCartCartTotalRepository" sortOrder="1"/>
          </type>



          app/code/SR/MagentoCommunity/Plugin/Quote/Model/Cart/CartTotalRepository.php




          <?php
          namespace SRMagentoCommunityPluginQuoteModelCart;

          use MagentoFrameworkSerializeSerializerJson;

          class CartTotalRepository

          /**
          * @var Json
          */
          private $json;

          /**
          * DefaultConfigProvider constructor.
          * @param Json $json
          */
          public function __construct(
          Json $json
          )
          $this->json = $json;


          public function afterGet(
          MagentoQuoteModelCartCartTotalRepository $subject,
          $quoteTotals
          )
          $quoteItems = $quoteTotals->getItems();
          $items = [];

          /** @var MagentoQuoteModelCartTotalsItem $item */
          foreach ($quoteItems as $index => $item)
          if ($options = $item->getOptions())
          $options = $this->json->unserialize($options);
          foreach ($options as $key => $option)
          if (isset($option['full_view']))
          $options[$key]['full_view'] = html_entity_decode($option['full_view']);


          $item->setOptions($this->json->serialize($options));

          $items[$index] = $item;


          $quoteTotals->setItems($items);
          return $quoteTotals;








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 29 at 7:48

























          answered May 28 at 17:14









          Sohel RanaSohel Rana

          24.3k34663




          24.3k34663












          • Now it's working on minicart, but still not working checkout page.

            – Rishabh Shukla
            May 28 at 19:34











          • Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

            – Sohel Rana
            May 28 at 21:49











          • Please mention checkout page method for plugin.

            – Rishabh Shukla
            May 29 at 5:47












          • Check updated answer

            – Sohel Rana
            May 29 at 7:36











          • Is it working for you? If yes, accept this answer that will help other.

            – Sohel Rana
            May 30 at 6:35

















          • Now it's working on minicart, but still not working checkout page.

            – Rishabh Shukla
            May 28 at 19:34











          • Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

            – Sohel Rana
            May 28 at 21:49











          • Please mention checkout page method for plugin.

            – Rishabh Shukla
            May 29 at 5:47












          • Check updated answer

            – Sohel Rana
            May 29 at 7:36











          • Is it working for you? If yes, accept this answer that will help other.

            – Sohel Rana
            May 30 at 6:35
















          Now it's working on minicart, but still not working checkout page.

          – Rishabh Shukla
          May 28 at 19:34





          Now it's working on minicart, but still not working checkout page.

          – Rishabh Shukla
          May 28 at 19:34













          Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

          – Sohel Rana
          May 28 at 21:49





          Your question is about minicart, why you test in checkout page. For other page like checkout, cart page etc you need to do same things.

          – Sohel Rana
          May 28 at 21:49













          Please mention checkout page method for plugin.

          – Rishabh Shukla
          May 29 at 5:47






          Please mention checkout page method for plugin.

          – Rishabh Shukla
          May 29 at 5:47














          Check updated answer

          – Sohel Rana
          May 29 at 7:36





          Check updated answer

          – Sohel Rana
          May 29 at 7:36













          Is it working for you? If yes, accept this answer that will help other.

          – Sohel Rana
          May 30 at 6:35





          Is it working for you? If yes, accept this answer that will help other.

          – Sohel Rana
          May 30 at 6:35










          Rishabh Shukla is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Rishabh Shukla is a new contributor. Be nice, and check out our Code of Conduct.












          Rishabh Shukla is a new contributor. Be nice, and check out our Code of Conduct.











          Rishabh Shukla is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f276447%2fminicart-html-text-showing-raw-required-formatted-text-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form