i am working on magento2 checkout page and i want to add tool tip after street address in shipping information section how can i do this please adivce.
1 Answer
Try the following way using plugin:
app/code/SR/MagentoCommunity/etc/frontend/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\Block\Checkout\LayoutProcessor">
<plugin name="sr_ModuleName_checkout_layout_processor"
type="SR\MagentoCommunity\Plugin\Block\LayoutProcessor" sortOrder="1"/>
</type>
</config>
app/code/SR/MagentoCommunity/Plugin/Block/LayoutProcessor.php
<?php
namespace SR\MagentoCommunity\Plugin\Block;
class LayoutProcessor
{
/**
* @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
* @param array $jsLayout
* @return array
*/
public function afterProcess(
\Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
array $jsLayout
) {
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['street']['children'][0]['config']['tooltip'] = [
'description' => 'This is test tooltip for street'
];
return $jsLayout;
}
}
-
Not working. I added your files, ran setup and static commands but not helpful. Commented Apr 18, 2019 at 6:14
-
-
yes I created a new module, but not added etc module.xml, should I add that also? Commented Apr 18, 2019 at 6:32
-
-
just give me 10 mins, I'll add that and let you know Commented Apr 18, 2019 at 6:36