Пример #1
0
 /**
  * Retrieve url for adding product to wishlist with params
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @param array $params
  *
  * @return  string|bool
  */
 public function getAddUrlWithParams($item, array $params = array())
 {
     $productId = null;
     if ($item instanceof Mage_Catalog_Model_Product) {
         $productId = $item->getEntityId();
     }
     if ($item instanceof Mage_Wishlist_Model_Item) {
         $productId = $item->getProductId();
     }
     if ($productId) {
         $params['product'] = $productId;
         $params[Mage_Core_Model_Url::FORM_KEY] = $this->_getSingletonModel('core/session')->getFormKey();
         return $this->_getUrlStore($item)->getUrl('wishlist/index/add', $params);
     }
     return false;
 }
Пример #2
0
 /**
  * Retrieve url for adding product to wishlist with params
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @param array $params
  *
  * @return  string|bool
  */
 public function getAddUrlWithParams($item, array $params = array())
 {
     $productId = null;
     if ($item instanceof Mage_Catalog_Model_Product) {
         $productId = $item->getEntityId();
     }
     if ($item instanceof Mage_Wishlist_Model_Item) {
         $productId = $item->getProductId();
     }
     if ($productId) {
         $params['product'] = $productId;
         return $this->_getUrlStore($item)->getUrl('wishlist/index/add', $params);
     }
     return false;
 }