looking at the code is always a good idea. in this case, there is useful info in the documentation of the code.
the following snippet is from:
includes/classes/shopping_cart.php
PHP Code:
/**
* Get the quantity of an item in the cart
* NOTE: This accepts attribute hash as $products_id, such as: 12:a35de52391fcb3134
* ... and treats 12 as unique from 12:a35de52391fcb3134
* To lookup based only on prid (ie: 12 here) regardless of the attribute hash, use another method: in_cart_product_total_quantity()
*
* @param int|string $uprid product ID of item to check
* @return int|float the quantity of the item
*/
public function get_quantity($uprid)
i would use the method:
in_cart_product_total_quantity()
instead of
get_quantity()
and see if that provides the desired results.
best.