That is giving me the quantity of that product number in the cart, which I also needed to know. But not the actual product number itself. But it does confirm that the software is seeing '171' as the product ID, because it returns the correct quantity. So I am still totally stumped as to why this is happening:
The first comparison works for every single other product id in our inventory, but not for the one with an id of 171. That's why I was trying to find out what the code was actually seeing there. The second statement confirms that it is seeing 171. I can use the second comparison as a workaround, but the first one ought to work.Code:echo $_SESSION['cart']->get_quantity('171'); // RETURNS ZERO echo $_SESSION['cart']->in_cart_check('products_id', '171'); // RETURNS 1, WHICH IS CORRECT
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
i would use the method: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)
in_cart_product_total_quantity()
instead of
get_quantity()
and see if that provides the desired results.
best.
Today we noticed intermittent issues of getting: "Your order's details have changed. Please review the current values and re-submit." Reloading the page or changing the shipping method will let the order go through. Only recent changes were upgrading USPS from K11i to K11j (I typed in the password), sitemap from 3.99 to 4, GPSF from 1.0.0 to 1.0.1, and edit orders from 4.7.0beta2 to 4.7.0 released. It happens using cashiers check / money order, so not a payment module issue.
Guessing USPS API issue? Anyone else seeing this?