I want to display sku in order summmary after product name.
I've created pluging which will called afterGetConfig
to modified totalsData you can see below code for it.
class ConfigProviderPlugin extends \Magento\Framework\Model\AbstractModel
{
public function afterGetConfig(\Magento\Checkout\Model\DefaultConfigProvider $subject, array $result)
{
$items = $result['totalsData']['items'];
for($i=0;$i<count($items);$i++){
$items[$i]['sku'] = "dgd";
}
return $result;
}
}
Then in detail.html
i've added
<div class="details-sku">
<span class="label"><!-- ko i18n: 'Sku' --><!-- /ko --></span>
<span class="value" data-bind="text: $parent.sku"></span>
</div>
But i can't see sku value there. i can only see lable. see below screenshot.
Best Answer
Override one template (simplification of Joey's answer). Bind directly to window object.checkoutConfig.quoteItemData object.
"===" cant be used in
item_id == $parents[1].item_id
so we use "=="