For the Quantity of a specific Product with a prid:
Code:
/**
* Method to get the quantity of an item in the cart
*
* @param mixed product ID of item to check
* @return decimal the quantity of the item
*/
function get_quantity($products_id) {
For a Product without regard to the prid, when the Mixed is set to YES on the Product:
Code:
/**
* Method to calculate item quantity, bounded the mixed/min units settings
*
* @param boolean product id of item to check
* @return deciaml
*/
function in_cart_mixed_discount_quantity($products_id) {
For the total quantity of items in the cart:
Code:
/**
* Method to count total number of items in cart
*
* Note this is not just the number of distinct items in the cart,
* but the number of items adjusted for the quantity of each item
* in the cart, So we have had 2 items in the cart, one with a quantity
* of 3 and the other with a quantity of 4 our total number of items
* would be 7
*
* @return total number of items in cart
*/
function count_contents() {
Bookmarks