Example #1
0
 /**
  * Retrieve params for updating product in wishlist
  *
  * @param \Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item
  *
  * @return  string|false
  */
 public function getUpdateParams($item)
 {
     $itemId = null;
     if ($item instanceof \Magento\Catalog\Model\Product) {
         $itemId = $item->getWishlistItemId();
         $productId = $item->getId();
     }
     if ($item instanceof \Magento\Wishlist\Model\Item) {
         $itemId = $item->getId();
         $productId = $item->getProduct()->getId();
     }
     $url = $this->_getUrl('wishlist/index/updateItemOptions');
     if ($itemId) {
         $params = array('id' => $itemId, 'product' => $productId);
         return $this->_postDataHelper->getPostData($url, $params);
     }
     return false;
 }