Skip to main content

I want to show a Simple product ofwith a Configurable product name on ( Mini-cart  , Cart page, and checkout page ). I have successfully achieved to shownshow the name on Mini-cart and Cart page but on the Checkout page iI have cretaedcreated a module whichthat is successfully showing the Name on the shipping page but utit doesn't show on the Payment page can any oneanyone have any idea why it is not showing there.

I have showsshown the value by

As in my app/design/frontend/Mgs/claue_child/Magento_Checkout/web/template/summary/item/details.html iI have used

to show the name so that's why iI have returned the value with this but still not getting a name.

Any help is appriciatedappreciated.

I want to show Simple product of Configurable product name on ( Mini-cart  , Cart page and checkout page ). I have successfully achieved to shown the name on Mini-cart and Cart page but on Checkout page i have cretaed a module which is successfully showing Name on shipping page but ut doesn't show on Payment page can any one have any idea why it is not showing there.

I have shows the value by

As in my app/design/frontend/Mgs/claue_child/Magento_Checkout/web/template/summary/item/details.html i have used

to show the name so that's why i have returned the value with this but still not getting name.

Any help is appriciated.

I want to show a Simple product with a Configurable product name on ( Mini-cart, Cart page, and checkout page ). I have successfully achieved to show the name on Mini-cart and Cart page but on the Checkout page I have created a module that is successfully showing the Name on the shipping page but it doesn't show on the Payment page can anyone have any idea why it is not showing there.

I have shown the value by

As in my app/design/frontend/Mgs/claue_child/Magento_Checkout/web/template/summary/item/details.html I have used

to show the name so that's why I have returned the value with this but still not getting a name.

Any help is appreciated.

added 17 characters in body
Source Link
Prits
  • 623
  • 8
  • 50
<?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="Magento\Checkout\Model\DefaultConfigProvider"> 
  <plugin name="AddAttPlug" type="Hl\Checkoutname\Plugin\ConfigProviderPlugin" />
  </type>
  <type name="Magento\Catalog\Model\Layer">name="Magento\Quote\Model\Cart\CartTotalRepository">
    <plugin name="Hl_Checkoutname_Plugin_Frontend_Magento_Catalog_Model_Layer" type="Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer\CartTotalRepository" sortOrder="10"sortOrder="15" disabled="false"/>
  </type>
 </config>

to show the name so that's why i have returned the value with this but still not getting name.

enter image description here

<?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="Magento\Checkout\Model\DefaultConfigProvider"> 
  <plugin name="AddAttPlug" type="Hl\Checkoutname\Plugin\ConfigProviderPlugin" />
  </type>
  <type name="Magento\Catalog\Model\Layer">
  <plugin name="Hl_Checkoutname_Plugin_Frontend_Magento_Catalog_Model_Layer" type="Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer\CartTotalRepository" sortOrder="10" disabled="false"/>
  </type>
</config>

to show the name so that's why i have returned the value with this but still not getting name.

<?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="Magento\Checkout\Model\DefaultConfigProvider"> 
 <plugin name="AddAttPlug" type="Hl\Checkoutname\Plugin\ConfigProviderPlugin" />
 </type>
  <type name="Magento\Quote\Model\Cart\CartTotalRepository">
    <plugin name="Hl_Checkoutname_Plugin_Frontend_Magento_Catalog_Model_Layer" type="Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer\CartTotalRepository" sortOrder="15" disabled="false"/>
  </type>
 </config>

to show the name so that's why i have returned the value with this but still not getting name.

enter image description here

added 2336 characters in body
Source Link
Prits
  • 623
  • 8
  • 50

My di.xml file path: app/code/Hl/Checkoutname/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="Magento\Checkout\Model\DefaultConfigProvider"> 
  <plugin name="AddAttPlug" type="Hl\Checkoutname\Plugin\ConfigProviderPlugin" />
  </type>
  <type name="Magento\Catalog\Model\Layer">
  <plugin name="Hl_Checkoutname_Plugin_Frontend_Magento_Catalog_Model_Layer" type="Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer\CartTotalRepository" sortOrder="10" disabled="false"/>
  </type>
</config>

My Plugin file path : app/code/Hl/Checkoutname/Plugin/Frontend/Magento/Catalog/Model/Layer/CartTotalRepository.php

<?php
    declare(strict_types=1);

    namespace Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer;

    use Magento\Catalog\Api\ProductRepositoryInterface;

    class CartTotalRepository
    {
    /**
     * @var ProductRepositoryInterface
     */
    private $productRepository;

    public function __construct(ProductRepositoryInterface $productRepository)
    {
        $this->productRepository = $productRepository;
    }

    public function afterGet(
        \Magento\Quote\Model\Cart\CartTotalRepository $subject,
        $result,
        $cartId
    ) {
        if ($result instanceof \Magento\Quote\Api\Data\TotalsInterface) {
            $items = $result->getItems();
            $resultItems = [];
            foreach ($items as $eachItem) {
                $name = $eachItem->getName();
                $eachItem->setName($name);
                // Do your code
                $resultItems['childname'] = $eachItem;
            }
            $result->setItems($resultItems);
        }
        return $result;
    }
    }

As in my app/design/frontend/Mgs/claue_child/Magento_Checkout/web/template/summary/item/details.html i have used

 <strong class="product-item-childname" data-bind="html: $parent.childname"></strong> 

to show the name so that's why i have returned the value with this but still not getting name.

Any help is appriciated.

Any help is appriciated.

My di.xml file path: app/code/Hl/Checkoutname/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="Magento\Checkout\Model\DefaultConfigProvider"> 
  <plugin name="AddAttPlug" type="Hl\Checkoutname\Plugin\ConfigProviderPlugin" />
  </type>
  <type name="Magento\Catalog\Model\Layer">
  <plugin name="Hl_Checkoutname_Plugin_Frontend_Magento_Catalog_Model_Layer" type="Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer\CartTotalRepository" sortOrder="10" disabled="false"/>
  </type>
</config>

My Plugin file path : app/code/Hl/Checkoutname/Plugin/Frontend/Magento/Catalog/Model/Layer/CartTotalRepository.php

<?php
    declare(strict_types=1);

    namespace Hl\Checkoutname\Plugin\Frontend\Magento\Catalog\Model\Layer;

    use Magento\Catalog\Api\ProductRepositoryInterface;

    class CartTotalRepository
    {
    /**
     * @var ProductRepositoryInterface
     */
    private $productRepository;

    public function __construct(ProductRepositoryInterface $productRepository)
    {
        $this->productRepository = $productRepository;
    }

    public function afterGet(
        \Magento\Quote\Model\Cart\CartTotalRepository $subject,
        $result,
        $cartId
    ) {
        if ($result instanceof \Magento\Quote\Api\Data\TotalsInterface) {
            $items = $result->getItems();
            $resultItems = [];
            foreach ($items as $eachItem) {
                $name = $eachItem->getName();
                $eachItem->setName($name);
                // Do your code
                $resultItems['childname'] = $eachItem;
            }
            $result->setItems($resultItems);
        }
        return $result;
    }
    }

As in my app/design/frontend/Mgs/claue_child/Magento_Checkout/web/template/summary/item/details.html i have used

 <strong class="product-item-childname" data-bind="html: $parent.childname"></strong> 

to show the name so that's why i have returned the value with this but still not getting name.

Any help is appriciated.

Source Link
Prits
  • 623
  • 8
  • 50
Loading