本文整理匯總了PHP中ShoppingCart::set_quantity_item_link方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShoppingCart::set_quantity_item_link方法的具體用法?PHP ShoppingCart::set_quantity_item_link怎麽用?PHP ShoppingCart::set_quantity_item_link使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShoppingCart
的用法示例。
在下文中一共展示了ShoppingCart::set_quantity_item_link方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AJAXLinkHiddenField
/**
* Used for storing the quantity update link for ajax use.
*/
function AJAXLinkHiddenField()
{
if ($quantitylink = ShoppingCart::set_quantity_item_link($this->item->getProductIDForSerialization(), null, $this->parameters)) {
$attributes = array('type' => 'hidden', 'class' => 'ajaxQuantityField_qtylink', 'name' => $this->item->MainID() . '_Quantity_SetQuantityLink', 'value' => $quantitylink);
$formfield = new FormField('hack');
return $formfield->createTag('input', $attributes);
}
}
示例2: testRemoveFromCart
function testRemoveFromCart()
{
/* Retrieve the product to compare from fixture */
$product = $this->objFromFixture('Product', 'mp3player');
$anotherproduct = $this->objFromFixture('Product', 'tshirt');
/* add items via url */
$this->get(ShoppingCart::set_quantity_item_link($product->ID, $product->class) . "?quantity=5");
$this->get(ShoppingCart::add_item_link($anotherproduct->ID, $product->class));
/* remove items via url */
$this->get(ShoppingCart::remove_item_link($product->ID, $product->class));
$this->get(ShoppingCart::remove_item_link($anotherproduct->ID, $product->class));
$items = ShoppingCart::get_items();
$this->assertEquals($items->Count(), 1, 'There is 1 item in the cart');
$this->assertEquals($items->First()->Quantity, 4, 'We have 4 mp3 players in the cart.');
ShoppingCart::clear();
//test clearing cart
$this->assertEquals(ShoppingCart::get_items(), null, 'Cart is clear');
//items is a databoject set, and will therefore be null when cart is empty.
//TODO: remove item not in cart - insanity check
}
示例3: setquantityLink
function setquantityLink()
{
return ShoppingCart::set_quantity_item_link($this->_productID, $this->_productVariationID);
}
示例4: setquantityLink
function setquantityLink()
{
return ShoppingCart::set_quantity_item_link($this->_productID, null, $this->linkParameters());
}