Guest Big Ben Posted August 12, 2012 Share Posted August 12, 2012 Since we upgraded We are in a major pickle here because only the most current order will show items attached to it. Each time a new order is replaced the items in the order before it disappear. Only the most current order will have items. Then once a new order is placed the previous order will loose all of its items. It does not seem to matter what payment module we use, as soon as new order is placed the order before it looses all if it's items. As of now all of our open orders are missing the items that were ordered. I am attaching a screen shot of what we see when we log in. Has anyone had this happen to them? If so, what did you do to resolve it? Thank you, Ben Quote Link to comment Share on other sites More sharing options...
oldman79 Posted August 12, 2012 Share Posted August 12, 2012 I had the same problem as you have. If customers orders in 2012-08-10, then today 2012-08-12 show there is no more items in their order. This is very weird. I hope CC will correct it soon. I really don't know why CC keep upgrade for new version, then create more bugs that don't have in previous version. Quote Link to comment Share on other sites More sharing options...
Lastwolf Posted August 13, 2012 Share Posted August 13, 2012 I have a support ticket on the matter, thought it was fixed on friday, but logged on this morning and it's gone again. Getting pretty tired of all the problems tbh, everytime I update something breaks, not sure if I like any alternatives though, the fact that 5 versions and a couple of years have went by and I still have to go to 3rd party vendors for a decent post prices model is pretty crazy. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 13, 2012 Share Posted August 13, 2012 Others have told me that there are the proper records in the CC_order_inventory table (if I didn't misunderstand their responses). That is, the CC_order_summary table has order_id number 2012-08-11-123456-1234, and matching records in CC_order_inventory with the same order_id number. The problem then is where is the code that is causing either: no query to get those inventory to be executed, the recordset is returned but not processed, or maybe some javascript is causing the browser to 'hide' it. (I mention this last possibility because of the latest rash of issues involving the jQuery code.) Please, would you verify for your store, whether the records actually exist in CC_order_inventory for a cart_order_id number of a suspect order. (Use phpMyAdmin or something similar, usually found in your hosting account's control panel.) After that, in the admin screens of your store, go to Store Settings, Advanced tab, Performance section, and enable debugging. Bring up an order showing no inventory (but there should be). At the bottom of the page, scan the MySQL queries looking for any call to CubeCart_order_inventory. (It won't show what was returned, but at least the call was made.) After that, use your browser's View Source feature to scan through the HTML and look for where the list of inventory items should be. Please let us know what you see for your store. Quote Link to comment Share on other sites More sharing options...
platedepot Posted August 13, 2012 Share Posted August 13, 2012 I'm having the same problem. I queried the CC_order_inventory and found only 55 rows, which represent yesterday's orders. CC_order_summary has over 4000 rows, representing orders going back to 2009. Debugging an order showed a call made to CC_order_inventory, but since there are no rows with that order number anymore, nothing was returned. I've taken the store offline until this gets fixed. MARK www.platedepot.com Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 13, 2012 Share Posted August 13, 2012 CC_order_inventory has only 55 rows. So, either: * a rogue TRUNCATE query was sent to CC_order_inventory * a rogue DELETE everything query was sent * a proper DELETE query was sent but the form to manage order summaries is faulty by returning the form element named 'inv_remove[]' as checked when it shouldn't be. Please answer: Have you run a Backup from the maintenance screen? Do you use a table prefix for the collection of CubeCart tables in the database? Please also look at the tables CubeCart_order_tax, _order_notes, _order_history for what would seem to be an abnormally low number of records leaving very recent cart_order_id numbers. Quote Link to comment Share on other sites More sharing options...
platedepot Posted August 13, 2012 Share Posted August 13, 2012 I did a backup both in Maintenance and in my hosting service (Godaddy) right before upgrading. I have both backups available. I do not use a table prefix that I know of (in other words, I didn't modify anything from the regular CubeCart setup - I'm not that tech savvy. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 13, 2012 Share Posted August 13, 2012 I found something weird. There is a routine that can update the contents of an order (but what's the scope of this order?) if it's status is prior to "Processing". (Again, from who's point of view?) If this routine is called, and the order is prior to Processing, then records in CC_downloads are deleted where 'order_inv_id' is equal to an unset variable. Same for CC_order_inventory. I'll need to figure out where all that calls this function. This is a change from CC511 to CC512 (carried over to CC513). If you are wanting to do this as it may restore a bug that afflicted CC511: In the file /classes/order.class.php for CC512/513, very near the end, find this: private function _updateOrder() { // Add new items to the order, as long as its only 'Pending' if (!isset($this->_basket['order_status']) || $this->_basket['order_status'] < self::ORDER_PROCESS) { ## Remove digital download record $GLOBALS['db']->delete('CubeCart_downloads', array('order_inv_id' => $key)); $GLOBALS['db']->delete('CubeCart_order_inventory', array('order_inv_id' => $key)); // Add products foreach ($this->_basket['contents'] as $key => $item) { $basket_items[] = $item['id']; if (!is_array($stored_items) || !in_array($item['id'], $stored_items)) { $product = $this->_orderAddProduct($item); $this->_basket['contents'][$key] = (is_array($product)) ? array_merge($product, $item) : $item; } else { $price = (Tax::getInstance()->salePrice($item['price'], $item['sale_price'], false)) ? $item['sale_price'] : $item['price']; $product_data = $GLOBALS['catalogue']->getProductData($item['id'], $item['quantity']); Tax::getInstance()->productTax($price, (int)$item['tax_type'], (bool)$product_data['tax_inclusive']); } } return true; } return false; } Replace with CC511 version: private function _updateOrder() { // Add new items to the order, as long as its only 'Pending' if (!isset($this->_basket['order_status']) || $this->_basket['order_status'] < self::ORDER_PROCESS) { $items = $GLOBALS['db']->select('CubeCart_order_inventory', array('id', 'product_id', 'digital'), array('cart_order_id' => $this->_order_id)); if ($items) { foreach ($items as $item) { $stored_items[$item['id']] = $item['product_id']; if ($item['digital']) $digital[] = $item['id']; } } // Add products foreach ($this->_basket['contents'] as $key => $item) { $basket_items[] = $item['id']; if (!is_array($stored_items) || !in_array($item['id'], $stored_items)) { $product = $this->_orderAddProduct($item); $this->_basket['contents'][$key] = (is_array($product)) ? array_merge($product, $item) : $item; } else { $price = (Tax::getInstance()->salePrice($item['price'], $item['sale_price'], false)) ? $item['sale_price'] : $item['price']; $product_data = $GLOBALS['catalogue']->getProductData($item['id'], $item['quantity']); Tax::getInstance()->productTax($price, (int)$item['tax_type'], (bool)$product_data['tax_inclusive']); } } ## Remove products foreach ($stored_items as $key => $id) { if (!in_array($id, $basket_items)) { if (in_array($id, $digital)) { ## Remove digital download record $GLOBALS['db']->delete('CubeCart_downloads', array('order_inv_id' => $key)); } ## Remove product order record $GLOBALS['db']->delete('CubeCart_order_inventory', array('id' => $key)); } } return true; } return false; } Again, I do not know if this change was supposed to fix a bug. But CC512/513 version of this function has some definite problems. Quote Link to comment Share on other sites More sharing options...
platedepot Posted August 13, 2012 Share Posted August 13, 2012 Could this have been a fix to a bug that I was experiencing in 5.1.1? Customers would place an order, then get transferred to PayPal to pay, and they would only be charged postage. This was starting to occur in the last two weeks, which prompted me to upgrade in the first place. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 13, 2012 Share Posted August 13, 2012 I don't have the information to marry a change in the code to a particular bug (other than the ones I have reported). But, I later learn the function was changed to fix bug #255. Quote Link to comment Share on other sites More sharing options...
oldman79 Posted August 13, 2012 Share Posted August 13, 2012 I found something weird. There is a routine that can update the contents of an order (but what's the scope of this order?) if it's status is prior to "Processing". (Again, from who's point of view?) If this routine is called, and the order is prior to Processing, then records in CC_downloads are deleted where 'order_inv_id' is equal to an unset variable. Same for CC_order_inventory. I'll need to figure out where all that calls this function. This is a change from CC511 to CC512 (carried over to CC513). If you are wanting to do this as it may restore a bug that afflicted CC511: In the file /classes/order.class.php for CC512/513, very near the end, find this: private function _updateOrder() { // Add new items to the order, as long as its only 'Pending' if (!isset($this->_basket['order_status']) || $this->_basket['order_status'] < self::ORDER_PROCESS) { ## Remove digital download record $GLOBALS['db']->delete('CubeCart_downloads', array('order_inv_id' => $key)); $GLOBALS['db']->delete('CubeCart_order_inventory', array('order_inv_id' => $key)); // Add products foreach ($this->_basket['contents'] as $key => $item) { $basket_items[] = $item['id']; if (!is_array($stored_items) || !in_array($item['id'], $stored_items)) { $product = $this->_orderAddProduct($item); $this->_basket['contents'][$key] = (is_array($product)) ? array_merge($product, $item) : $item; } else { $price = (Tax::getInstance()->salePrice($item['price'], $item['sale_price'], false)) ? $item['sale_price'] : $item['price']; $product_data = $GLOBALS['catalogue']->getProductData($item['id'], $item['quantity']); Tax::getInstance()->productTax($price, (int)$item['tax_type'], (bool)$product_data['tax_inclusive']); } } return true; } return false; } Replace with CC511 version: private function _updateOrder() { // Add new items to the order, as long as its only 'Pending' if (!isset($this->_basket['order_status']) || $this->_basket['order_status'] < self::ORDER_PROCESS) { $items = $GLOBALS['db']->select('CubeCart_order_inventory', array('id', 'product_id', 'digital'), array('cart_order_id' => $this->_order_id)); if ($items) { foreach ($items as $item) { $stored_items[$item['id']] = $item['product_id']; if ($item['digital']) $digital[] = $item['id']; } } // Add products foreach ($this->_basket['contents'] as $key => $item) { $basket_items[] = $item['id']; if (!is_array($stored_items) || !in_array($item['id'], $stored_items)) { $product = $this->_orderAddProduct($item); $this->_basket['contents'][$key] = (is_array($product)) ? array_merge($product, $item) : $item; } else { $price = (Tax::getInstance()->salePrice($item['price'], $item['sale_price'], false)) ? $item['sale_price'] : $item['price']; $product_data = $GLOBALS['catalogue']->getProductData($item['id'], $item['quantity']); Tax::getInstance()->productTax($price, (int)$item['tax_type'], (bool)$product_data['tax_inclusive']); } } ## Remove products foreach ($stored_items as $key => $id) { if (!in_array($id, $basket_items)) { if (in_array($id, $digital)) { ## Remove digital download record $GLOBALS['db']->delete('CubeCart_downloads', array('order_inv_id' => $key)); } ## Remove product order record $GLOBALS['db']->delete('CubeCart_order_inventory', array('id' => $key)); } } return true; } return false; } Again, I do not know if this change was supposed to fix a bug. But CC512/513 version of this function has some definite problems. This code didn't work. Hope staff will fixed this bug soon as possible. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 13, 2012 Share Posted August 13, 2012 What do you mean, "It didn't work"? By making this change, were you expecting the order's inventory items to return? In my opinion, past order's inventory items won't be restored until you can restore the table CubeCart_order_inventory (and probably CubeCart_downloads) from a backup. In my opinion, by backstepping to the CC511 version of this function, there shouldn't be any new mysterious loss of order inventory. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted August 14, 2012 Share Posted August 14, 2012 This is a huge problem. I cannot believe they keep releasing updates causing this many problems. Is it safe to restore CubeCart_order_inventory without it over writing new order data after the upgrade? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 14, 2012 Share Posted August 14, 2012 As I understand it, it's going to take some kind of merging of the newest order data with the past data, or you will lose all your new orders in a restore. I imagine they're working feverishly to fix this major issue, but your frustration is definitely understandable!!! Quote Link to comment Share on other sites More sharing options...
oldman79 Posted August 14, 2012 Share Posted August 14, 2012 This is a huge problem. I cannot believe they keep releasing updates causing this many problems. Is it safe to restore CubeCart_order_inventory without it over writing new order data after the upgrade? This is a terrible bug. I have many costumers scare about this issue. They said my store is not secure because have too many problem after upgrade new version. I really don't know why, each time cc release new version, then it is going to have a new bug, but that bug did already done fixed on the pass. Quote Link to comment Share on other sites More sharing options...
Guest dgsmra Posted August 14, 2012 Share Posted August 14, 2012 Guys, just wanted to let you know that I submitted a support ticket for this issue and Al got it cleared up in no time. I know it's been a difficult problem to deal with, but I appreciate Al getting my shop fixed ASAP. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 14, 2012 Share Posted August 14, 2012 So glad it's resolved for you!!! I've always been very impressed with the effort Al and his staff put in to fix these kinds of unintended consequence issues. Can you elaborate on how they fixed it? Was this the JQuery version problem or something else? What did they do to get your order data back together? Quote Link to comment Share on other sites More sharing options...
Guest TFS Posted August 14, 2012 Share Posted August 14, 2012 I had the issue previously and raised a support ticket, Al resolved it and was all working fine earlier today but now orders are coming through this evening without any order inventory again! Anyone know what's going on? All inventory details even for past orders marked as completed has also disappeared. I spent today calling customers to ask them what they ordered because we didn't know which was kind of embarrasing, not looking forward to having to do it again tomorrow. Quote Link to comment Share on other sites More sharing options...
Guest dgsmra Posted August 14, 2012 Share Posted August 14, 2012 TFS, you're right. My orders are back to missing items again. Hopefully Al will come up with another solution. Quote Link to comment Share on other sites More sharing options...
Guest thecanfool Posted August 15, 2012 Share Posted August 15, 2012 I'm having the same problem (along with some others) Orders are going blank when new orders are placed. I checked CubeCart_order_history and it is empty. My other major problem is registered customers and customers that choose to create an account at checkout get an error saying no shipping method available while new customers that do not create an account can checkout fine. I've already started another thread about this but thought there may be a connection. Think I will shut down until this gets fixed. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 15, 2012 Share Posted August 15, 2012 I'm trying to trace the path a variable takes through the checkout process. It has to do with whether the variable should be holding the 'numcode' of the country (840 for United States) vs. the actual name of the country. At least in the USPS shipping module, a test is made to determine if the destination country is the same as the origination (store's) country. One report I have is yes, the comparison is integer (840) against integer (840), but another report I have is that the comparison is string ('United States') against integer (840), resulting in International Shipping Rates. My tracings have entered a spaghetti bowl within the cart class. Feel free to read all the postings made in the past two weeks dealing with form element misbehaviors (all versions of Cubecart) and loss of inventory items in past orders (CC512/513). Start making a collection of the nightly backups of your database. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted August 15, 2012 Share Posted August 15, 2012 Are we sure this is a data issue? If Al fixed it for a user and it reverted back it, I would hope the store isn't deleting data. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 15, 2012 Share Posted August 15, 2012 Sorry about the ambiguity: thecanfool started another topic ("My other major problem...shipping...) and I was replying to that. Quote Link to comment Share on other sites More sharing options...
fettlebox Posted August 15, 2012 Share Posted August 15, 2012 I've been checking my orders over the last couple of days & all was well. Tonight, with no settings being altered the contents of my orders have gone - except for one pending test order I made a few hours back Fortunately I only have one to process & I still have the email notification with order details. I'll have to rig up the packing slip. Reluctantly I've upgraded to 5.1.4 ( I wanted to leave it for a few days to see what other pain was coming) as it lists a fix for this issue. Is the fix supposed to repopulate the old orders or just stop the same happening again going forward? It certainly hasn't sorted mine. Can I get the info out of a backup I made a few days back? I'd only loose the info from 2 or 3 orders if so. Only been open 2 weeks - hope it's not like this all the time. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 15, 2012 Share Posted August 15, 2012 That one latest pending order -- perhaps you removed or changed an item while viewing it in the View Cart page? In updating the order, the programming flaw could have actually deleted all existing records in the Order_Inventory table (list of items that comprised the order) and Downloads table. The fix is supposed to prevent the unintentional deletion of existing database records from those tables. Once those records have been deleted, the only place you will find them again is in the backups of your database. This fix cannot access your backups. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.