3

我想从产品列表页面(default/template/wishlist/item/column/image.php)的愿望清单中删除产品。

我在愿望清单页面中看到了删除 url 功能$this->getItemRemoveUrl($item)。但它在 image.php 中不起作用。即使我尝试过,

echo Mage::helper(‘wishlist’)->getRemoveUrl($_product)

它提供 URL 但不显示参数。

例如:-

domain.com/wishlist/index/remove (not working)
domain.com/wishlist/index/remove/item/3 (actual)

那么我该如何解决这个问题

4

3 回答 3

4

这个功能应该适合你

Mage::helper('wishlist')->getRemoveUrl($_product)
于 2012-11-27T17:45:12.320 回答
3

请将您的 xml 文件与 magento 默认的 xml 文件进行比较

可能有任何function遗漏或评论

还有另一种可能性或错误

helper('wishlist')->getRemoveUrl($_product)

可能$_product包含额外的空格或符号

请检查一下

于 2012-11-03T09:46:38.607 回答
1

使用getModel您可以删除心愿单产品,如下所示

Mage::getModel('wishlist/item')->load($id)->delete();
于 2012-11-03T11:41:30.180 回答