I am added a custom attribute in my wishlist knockout core file,
Code : https://codeshare.io/5ZlEv7 Line Number: 142
I want to override into my custom module,
I am created a custom module, how to properly included my changes
app/code/Vendor/Wishlist/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\Wishlist\CustomerData\Wishlist">
<plugin disabled="false" name="Vendor_Wishlist_Plugin_Magento_Wishlist_CustomerData_Wishlist" sortOrder="10" type="Vendor\Wishlist\Plugin\Magento\Wishlist\CustomerData\Wishlist"/>
</type>
</config>
app/code/Vendor/Wishlist/Plugin/Magento/Wishlist/CustomerData/Wishlist.php
<?php
/**
* Copyright © All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Vendor\Wishlist\Plugin\Magento\Wishlist\CustomerData;
class Wishlist
{
protected $wishlistHelper;
public function __construct(
\Magento\Wishlist\Helper\Data $wishlistHelper
)
{
$this->wishlistHelper = $wishlistHelper;
}
public function afterGetSectionData(
\Magento\Wishlist\CustomerData\Wishlist $subject,
$result
) {
// Your code here
return $result;
}
}
My question, how to include my changes into app/code/Vendor/Wishlist/Plugin/Magento/Wishlist/CustomerData/Wishlist.php
Should i add the whole function, code : https://codeshare.io/29AL38
or
should i add a specific line of change?
'product_brand' => $product->getResource()->getAttribute('brand')->getFrontend()->getValue($product),
New to module customization, anyone help thanks.