Jump to content
Sign in to follow this  
romank

Was there ever a bug regarding retrieveing orders and having wrong subtotals?

Recommended Posts

Hi, I have a specific question.

We are running a heavily modded version of the CubeCart 5.2.1. It is not possible to update the website due to the amount of changes we have done to the code - and before you say it, yes - I realize this means the issue I am asking about could have been caused by the changes I have made - even though I doubt it.

Recently we had few issues about subtotals of the orders being incorrect and customers paying less than they should have.

This is all the information and evidence I have regarding the latest occurrence:

  1. The customer places an order
  2. The customer does not proceed to the payment, the order status is Pending
  3. Up until this point, the basket data saved in the order_summary (and other log I have set up for other reasons) and the subtotal match
  4. I see multiple Pending status records in the order history, assuming the customer went back to the website, possibly retrieved the order and did.. something for half an hour: http://prntscr.com/i5vwd9
  5. Finally the order is paid for, with the inventory being slightly different (more items than there were during the original order placement) but without the subtotal changing
  6. So even though the order is now worth more than €500, the customer has paid the original amount, which is around €400
  7. We have a mod that adds a free gift to the order inventory if your subtotal exceeds a certain amount. This gift is always the last item in the inventory - however for this order, the sequence of the inventory items is following:
  • Items that match the original subtotal
  • Gift
  • Items that have probably been added later, and dont account into the subtotal and havent been paid for

This happens very rarely and the large amount of orders on our website works just fine.

When I try to do it from the customer point of view and cheat the system in any way, I am unable to do so. Whenever I place an order, log out, log in, retrieve and update, the subtotal is always correct.

So ultimately, my question is: Ever since 5.2.1 to this point, was there ever a bug that caused this to happen and was fixed on some of the versions after 5.2.1? Or does anyone have an idea what could be causing this and how to fix it?

Thank you in advance for any feedback, I realize its a specific question regarding obsolete and modded version.

Edited by romank

Share this post


Link to post
Share on other sites

Short answers: "Yes" and "I don't think we found it yet."

If there has been a fix, I don't recall what it was.

But I will look at the Github for these issues and see what has been done about it.

Share this post


Link to post
Share on other sites

I tried to look through the pile of the closed issues on Github, but only found one semi-relevant issue, regarding sale prices changing between the day of the order placement and actual payment. Nothing about the inventory items being different and the total not matching.

Have you encountered this bug personally on one of your stores, @bsmither?

I have also tried looking at the code and following the order retrieval logic, but cant seem to spot anything clearly wrong.

Its a shame I cant really find any more information on this, as its a very serious bug, costing the client money.

Share this post


Link to post
Share on other sites

In hopes to track this bug, I am now logging every single failed Catalogue->getProductData() call (as its called in Order->_orderAddProduct()) and I have found out that sometimes the Catalogue->getProductData()'s first param, $product_id (array or integer accepted) is not supplied at all, its just empty/false.

When looking at the order_summary serialized basket data for the order, I see this:

s:32:"5c87354b7ab4a7d3cd421b963b0439e5";a:2:{s:8:"quantity";i:14;s:16:"total_price_each";i:0;}
s:32:"54bd8e1d9cce8ca858b333e1fae18a6a";a:2:{s:8:"quantity";i:42;s:16:"total_price_each";i:0;}
s:32:"7b6bae8bbc657d771c065e7bc6536bff";a:2:{s:8:"quantity";i:4;s:16:"total_price_each";i:0;}
s:32:"04ebeede6c0048226bca995ffa6e19cf";a:2:{s:8:"quantity";i:26;s:16:"total_price_each";i:0;}
s:32:"d1886335d8aff15ddc9fbccb125ca283";a:2:{s:8:"quantity";i:7;s:16:"total_price_each";i:0;}
s:32:"b7a886bdebbeeee9cfe4ac748e1679e7";a:2:{s:8:"quantity";i:5;s:16:"total_price_each";i:0;}

The product_id key and all the data are missing.

So at some point between the customer happily shopping and having the items in this basket and placing an order, the basket data gets corrupted and the basket contents actually doesnt contain the product ID. Unbelievable.

Will try to set up more logs, any advice appreciated.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...