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?
I turned on OCP debug. and go the following. Those decimals look insane. Beyond that, I can't make any sence of whats happening.
2024-03-09 14:45:25 checkout_one: CHECKOUT_ONE_SHIPPING_CHECK (usps_USPS Ground AdvantageTM)
[{"id":"usps","module":"United States Postal Service (1 Boxes) (0 lbs, 12 oz)","methods":[{"id":"USPS Ground AdvantageTM","title":"USPS Ground Advantage™","cost":8.5,"insurance":0},{"id":"Priority MailRM","title":"Priority Mail®","cost":11.25,"insurance":0},{"id":"Priority Mail ExpressRM","title":"Priority Mail Express®","cost":36.4500000000000028421709430404007434844970703125,"insuranc e":0}],"tax":0,"icon":"<img src=\"includes\/templates\/template_default\/images\/icons\/shipping_usps.gif\" title=\"United States Postal Service\" alt=\"(image for) United States Postal Service\" width=\"50\" height=\"13\">"}]
["usps_USPS Ground AdvantageTM","usps_Priority MailRM","usps_Priority Mail ExpressRM"]
2024-03-09 14:45:25 checkout_one: CHECKOUT_ONE_AFTER_SHIPPING_QUOTES
{"id":"usps_USPS Ground AdvantageTM","title":"United States Postal Service (1 Boxes) (0 lbs, 12 oz) (USPS Ground Advantage™)","cost":8.5,"extras":""}order::__set_state(array(
'observerAliases' =>
array (
'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE',
),
'attachArray' =>
array (
),
'bestSellersUpdate' => NULL,
'billing' =>
array (
'firstname' => 'Todd',
'lastname' => 'Jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'country_id' => '223',
'format_id' => 7,
),
'content_type' => 'physical',
'customer' =>
array (
'firstname' => 'todd',
'lastname' => 'jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'format_id' => 7,
'telephone' => '',
'email_address' => '[email protected]',
),
'delivery' =>
array (
'firstname' => 'Todd',
'lastname' => 'Jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'country_id' => '223',
'format_id' => 7,
),
'doStockDecrement' => NULL,
'extra_header_text' => NULL,
'email_low_stock' => NULL,
'email_order_message' => NULL,
'info' =>
array (
'order_status' => '1',
'currency' => 'USD',
'currency_value' => '1.000000',
'payment_method' => '',
'payment_module_code' => '',
'coupon_code' => '',
'shipping_method' => 'United States Postal Service (1 Boxes) (0 lbs, 12 oz) (USPS Ground Advantage™)',
'shipping_module_code' => 'usps_USPS Ground AdvantageTM',
'shipping_cost' => 8.5,
'subtotal' => 64.0,
'shipping_tax' => 0,
'tax' => 3.5040000000000048885340220294892787933349609375,
'total' => 76.0040000000000048885340220294892787933349609375,
'tax_groups' =>
array (
'MO TAX 5.475%' => 3.5040000000000048885340220294892787933349609375,
),
'comments' => '',
'ip_address' => '73.67.37.4 - 73.67.37.4',
),
'orderId' => NULL,
'products' =>
array (
0 =>
array (
'qty' => 8.0,
'name' => '2024 European Rainbow Emoji Pez Loose SOS',
'model' => '',
'price' => '8.0000',
'tax' => 5.47500000000000763833440942107699811458587646484375,
'tax_groups' =>
array (
'MO TAX 5.475%' => 5.47500000000000763833440942107699811458587646484375,
),
'final_price' => 8.0,
'onetime_charges' => 0,
'weight' => 0.08000000000000000166533453693773481063544750213623046875,
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'id' => 8538,
'rowClass' => 'rowEven',
'products_weight' => 0.08000000000000000166533453693773481063544750213623046875,
'products_virtual' => 0,
'product_is_always_free_shipping' => 0,
'products_quantity_order_min' => 1.0,
'products_quantity_order_units' => 1.0,
'products_quantity_order_max' => 0.0,
'products_quantity_mixed' => 1,
'products_mixed_discount_quantity' => 1,
'tax_description' => 'MO TAX 5.475%',
),
),
'products_ordered' => NULL,
'products_ordered_attributes' => NULL,
'products_ordered_html' => NULL,
'queryReturnFlag' => NULL,
'send_low_stock_emails' => NULL,
'statuses' =>
array (
),
'total_cost' => NULL,
'total_tax' => NULL,
'total_weight' => NULL,
'totals' =>
array (
),
'use_external_tax_handler_only' => false,
)){"messages":[]}[{"id":"usps","module":"United States Postal Service (1 Boxes) (0 lbs, 12 oz)","methods":[{"id":"USPS Ground AdvantageTM","title":"USPS Ground Advantage™","cost":8.5,"insurance":0},{"id":"Priority MailRM","title":"Priority Mail®","cost":11.25,"insurance":0},{"id":"Priority Mail ExpressRM","title":"Priority Mail Express®","cost":36.4500000000000028421709430404007434844970703125,"insuranc e":0}],"tax":0,"icon":"<img src=\"includes\/templates\/template_default\/images\/icons\/shipping_usps.gif\" title=\"United States Postal Service\" alt=\"(image for) United States Postal Service\" width=\"50\" height=\"13\">"}]
2024-03-09 14:45:26 checkout_one: CHECKOUT_ONE_AFTER_ORDER_TOTAL_PROCESSING
order_total::__set_state(array(
'observerAliases' =>
array (
'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE',
),
'modules' =>
array (
0 => 'ot_subtotal.php',
1 => 'ot_coupon.php',
2 => 'ot_insurance.php',
3 => 'ot_tax.php',
4 => 'ot_shipping.php',
5 => 'ot_total.php',
),
))order::__set_state(array(
'observerAliases' =>
array (
'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE',
),
'attachArray' =>
array (
),
'bestSellersUpdate' => NULL,
'billing' =>
array (
'firstname' => 'Todd',
'lastname' => 'Jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'country_id' => '223',
'format_id' => 7,
),
'content_type' => 'physical',
'customer' =>
array (
'firstname' => 'todd',
'lastname' => 'jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'format_id' => 7,
'telephone' => '',
'email_address' => '[email protected]',
),
'delivery' =>
array (
'firstname' => 'Todd',
'lastname' => 'Jordan',
'company' => NULL,
'street_address' => '801 NW South Outer Rd.',
'suburb' => '',
'city' => 'Blue Springs',
'postcode' => '64015',
'state' => 'Missouri',
'state_code' => 'MO',
'zone_id' => '36',
'country' =>
array (
'id' => '223',
'title' => 'United States',
'iso_code_2' => 'US',
'iso_code_3' => 'USA',
),
'country_id' => '223',
'format_id' => 7,
),
'doStockDecrement' => NULL,
'extra_header_text' => NULL,
'email_low_stock' => NULL,
'email_order_message' => NULL,
'info' =>
array (
'order_status' => '1',
'currency' => 'USD',
'currency_value' => '1.000000',
'payment_method' => '',
'payment_module_code' => '',
'coupon_code' => '',
'shipping_method' => 'United States Postal Service (1 Boxes) (0 lbs, 12 oz) (USPS Ground Advantage™)',
'shipping_module_code' => 'usps_USPS Ground AdvantageTM',
'shipping_cost' => 8.5,
'subtotal' => 64.0,
'shipping_tax' => 0,
'tax' => 3.5040000000000048885340220294892787933349609375,
'total' => 76.0040000000000048885340220294892787933349609375,
'tax_groups' =>
array (
'MO TAX 5.475%' => 3.5040000000000048885340220294892787933349609375,
),
'comments' => '',
'ip_address' => '73.67.37.4 - 73.67.37.4',
),
'orderId' => NULL,
'products' =>
array (
0 =>
array (
'qty' => 8.0,
'name' => '2024 European Rainbow Emoji Pez Loose SOS',
'model' => '',
'price' => '8.0000',
'tax' => 5.47500000000000763833440942107699811458587646484375,
'tax_groups' =>
array (
'MO TAX 5.475%' => 5.47500000000000763833440942107699811458587646484375,
),
'final_price' => 8.0,
'onetime_charges' => 0,
'weight' => 0.08000000000000000166533453693773481063544750213623046875,
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'id' => 8538,
'rowClass' => 'rowEven',
'products_weight' => 0.08000000000000000166533453693773481063544750213623046875,
'products_virtual' => 0,
'product_is_always_free_shipping' => 0,
'products_quantity_order_min' => 1.0,
'products_quantity_order_units' => 1.0,
'products_quantity_order_max' => 0.0,
'products_quantity_mixed' => 1,
'products_mixed_discount_quantity' => 1,
'tax_description' => 'MO TAX 5.475%',
),
),
'products_ordered' => NULL,
'products_ordered_attributes' => NULL,
'products_ordered_html' => NULL,
'queryReturnFlag' => NULL,
'send_low_stock_emails' => NULL,
'statuses' =>
array (
),
'total_cost' => NULL,
'total_tax' => NULL,
'total_weight' => NULL,
'totals' =>
array (
),
'use_external_tax_handler_only' => false,
))zca_messageStack::__set_state(array(
'observerAliases' =>
array (
'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE',
),
'formats' =>
array (
'error' =>
array (
'params' => 'class="messageStackError larger"',
'icon' => '<img src="includes/templates/template_default/images/icons/error.png" title="Error" alt="(image for) Error" width="30" height="27">',
),
'success' =>
array (
'params' => 'class="messageStackSuccess larger"',
'icon' => '<img src="includes/templates/template_default/images/icons/success.png" title="Success" alt="(image for) Success" width="25" height="37">',
),
'warning' =>
array (
'params' => 'class="messageStackWarning larger"',
'icon' => '<img src="includes/templates/template_default/images/icons/warning.png" title="Warning" alt="(image for) Warning" width="30" height="28">',
),
'caution' =>
array (
'params' => 'class="messageStackCaution larger"',
'icon' => '<img src="includes/templates/template_default/images/icons/warning.png" title="Warning" alt="(image for) Warning" width="30" height="28">',
),
'default' =>
array (
'params' => 'class="messageStackError larger"',
),
),
'messages' =>
array (
),
))
2024-03-09 14:45:26 checkout_one: CHECKOUT_ONE_AFTER_PAYMENT_MODULES_SELECTION
payment::__set_state(array(
'observerAliases' =>
array (
'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE',
),
'doesCollectsCardDataOnsite' => false,
'form_action_url' => NULL,
'modules' =>
array (
0 => 'square_webPay.php',
1 => 'paypalwpp.php',
2 => 'moneyorder.php',
),
'paymentClass' =>
moneyorder::__set_state(array(
'_check' => NULL,
'code' => 'moneyorder',
'description' => 'Customers can mail in their payment. Their order confirmation email will ask them to: <br><br>Please make your check or money order payable to:<br>Chris Jordan<br><br>Mail your payment to:<br>Pez Collectors Store<br />
Chris Jordan<br />
21015 NE 171st St<br />
Kearney, MO 64060<br><br>Your order will not ship until we receive payment.',
'email_footer' => 'Please make your check or money order payable to:
Chris Jordan
Mail your payment to:
Pez Collectors Store
Chris Jordan
21015 NE 171st St
Kearney, MO 64060
Your order will not ship until we receive payment.',
'enabled' => true,
'order_status' => NULL,
'title' => 'Cashier\'s Check / Money Order',
'sort_order' => '3',
)),
'selected_module' => NULL,
)){"id":"usps_USPS Ground AdvantageTM","title":"United States Postal Service (1 Boxes) (0 lbs, 12 oz) (USPS Ground Advantage™)","cost":8.5,"extras":""}
2024-03-09 14:45:26 OnePageCheckout: getAddressValuesFromDb(22581, bill), returning: {"address_book_id":"22581","customers_id":"19319","zone_name":"Missouri","zone_c ode":"MO","gender":"\u0000","company":null,"firstname":"Todd","lastname":"Jordan ","street_address":"801 NW South Outer Rd.","suburb":"","postcode":"64015","city":"Blue Springs","state":"","country":"223","country_id":"223","zone_id":"36","error_sta te_input":false,"error":false,"country_has_zones":true,"validated":true,"selecte d_country":"223","state_field_label":"","show_pulldown_states":true}
2024-03-09 14:45:26 OnePageCheckout: getAddressValuesFromDb(22581, ship), returning: {"address_book_id":"22581","customers_id":"19319","zone_name":"Missouri","zone_c ode":"MO","gender":"\u0000","company":null,"firstname":"Todd","lastname":"Jordan ","street_address":"801 NW South Outer Rd.","suburb":"","postcode":"64015","city":"Blue Springs","state":"","country":"223","country_id":"223","zone_id":"36","error_sta te_input":false,"error":false,"country_has_zones":true,"validated":true,"selecte d_country":"223","state_field_label":"","show_pulldown_states":true}