Exemplo n.º 1
0
 /**
  * Retrieve params for adding product to wishlist
  *
  * @param \Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item
  * @param array $params
  * @return string
  */
 public function getAddParams($item, array $params = array())
 {
     $productId = null;
     if ($item instanceof \Magento\Catalog\Model\Product) {
         $productId = $item->getEntityId();
     }
     if ($item instanceof \Magento\Wishlist\Model\Item) {
         $productId = $item->getProductId();
     }
     $url = $this->_getUrlStore($item)->getUrl('wishlist/index/add');
     if ($productId) {
         $params['product'] = $productId;
     }
     return $this->_postDataHelper->getPostData($url, $params);
 }