2013-08-06 91 views
0

我爲wishlist實現了magento自定義API。Magento自定義API添加產品心願

有誰知道,如何添加心願。

我試過使用magento'wishlist'模塊,但產品沒有保存到心願單中。

我正在使用以下功能進行保存。

public function addNewItem($product, $customer_id, $buyRequest = null, $forciblySetQty = false) 
    { 
    } 

我可以使用這篇文章得到心願單。 http://pastebin.com/G7ci0Mhu

回答

0
This may help you 

     <?php $wishlist = Mage::getModel('wishlist/item')->load($_product->getId(),'product_id'); 
       if($wishlist->getId()) 
        //product is added 
       echo "Added! - Product is in the wishlist!"; 
       else 
        //add product to wishlist 
       echo "<a href='".$this->helper('wishlist')->getAddUrl($_product) ."'>Add This?</a>"; 
      ;?> 

     Mage::getModel('wishlist/item')->load($id)->delete(); 

     http://abhijitberadeveloper.blogspot.in/2012/07/product-add-wishlist.html 
http://docs.magentocommerce.com/Mage_Wishlist/Mage_Wishlist_Helper_Data.html#methodgetWishlistItemCollection 

http://docs.magentocommerce.com/Mage_Wishlist/Mage_Wishlist_Helper_Data.html#methodgetWishlistItemCollection