I have a magento 2 website where I want to share wishlist between websites (for logged in users and guest users). For ex. guest user added product1 to the wishlist from website1 and now user switches to website2 then user would be able to see the same product to wishlist already.
but now every website has own wishlist
magento is only providing sharing between stores not websites. I've tried some solutions but no luck, i used this solution for sharing cart between websites Magento 2 + How to share cart for guest users between multi websites and working great. i tried to use it with wishlist but didn't work
i extened the wishlist model and changed getSharedStoreIds function
/**
* @return int[]
*/
public function getSharedStoreIds()
{
if ($this->_storeIds === null || !is_array($this->_storeIds)) {
$_storeIds = [];
$stores = $this->_storeManager->getStores();
foreach ($stores as $store) {
$_storeIds[] = $store->getId();
}
$this->_storeIds = $_storeIds;
}
return $this->_storeIds;
}
but still not working