Jump to content

NOT Resolved - Only latest order witll show items in the order.


Guest Big Ben

Recommended Posts

Guest Big Ben

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest dgsmra

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest thecanfool

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
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.

×
×
  • Create New...