本文整理匯總了PHP中Magento\Wishlist\Helper\Data::getAddToCartUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Data::getAddToCartUrl方法的具體用法?PHP Data::getAddToCartUrl怎麽用?PHP Data::getAddToCartUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Wishlist\Helper\Data
的用法示例。
在下文中一共展示了Data::getAddToCartUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetAddToCartUrl
public function testGetAddToCartUrl()
{
$url = 'http://magento.com/wishlist/index/index/wishlist_id/1/?___store=default';
$this->store->expects($this->once())->method('getUrl')->with('wishlist/index/cart', ['item' => '%item%'])->will($this->returnValue($url));
$this->urlBuilder->expects($this->any())->method('getUrl')->with('wishlist/index/index', ['_current' => true, '_use_rewrite' => true, '_scope_to_url' => true])->will($this->returnValue($url));
$this->assertEquals($url, $this->model->getAddToCartUrl('%item%'));
}
示例2: _prepareLayout
/**
* Configure product view blocks
*
* @return $this
*/
protected function _prepareLayout()
{
// Set custom add to cart url
$block = $this->getLayout()->getBlock('product.info');
if ($block && $this->getWishlistItem()) {
$url = $this->_wishlistData->getAddToCartUrl($this->getWishlistItem());
$block->setCustomAddToCartUrl($url);
}
return parent::_prepareLayout();
}
示例3: testGetAddToCartUrl
public function testGetAddToCartUrl()
{
$this->assertEquals($this->url, $this->wishlistHelper->getAddToCartUrl('%item%'));
}