Jump to content

Order status not changing from Processing to Order Complete


Ferguson230

Recommended Posts

I had a couple of orders and after customers successfully made payments, the Order status changed from Pending to Processing. However, when I tried to change the Order status to Order Complete, I get an error saying something  like "Failed to update order status".  What is causing this? Everything else seems to be working fine except for that.

Link to comment
Share on other sites

The error message should be "Failed to update order."

This can happen if all of three actions result in either a fail, or just didn't do it.

1. Updating certain parts of the order summary (not including the status) failed, or nothing actually changed in the update.
2A. The order's current status is (for some reason) zero.
2B. Changing the order status to something when it is already at that status.
2C. The status or the order_id is missing when the admin code makes a call to the Order class to change the order status.
3. The admin entered some notes into the order's Notes tab and these notes failed to be databased, or there were no notes submitted.

View the order's History tab. Has your attempt to change the status been logged?

If you know how to have your browser show you what gets POSTed to your site (enable Persist mode), please check there after choosing the Complete status and clicking Save.

Link to comment
Share on other sites

Yes you're right, it says "Failed to update order".
This is what I'm seeing in the error log, do you think it's related?

File: [cubecart.class.php] Line: [1280] "SELECT `I`.`product_id`, `C`.`cat_name` FROM `CubeCart_category_index` AS `I` INNER JOIN `CubeCart_category` AS `C` ON `I`.`cat_id` = `C`.`cat_id` WHERE `I`.`product_id` IN (38,42,44,40,118) AND `primary` = 1 ;" - Table 'i4558236_cc1.CubeCart_category_index' doesn't exist

I checked (2B and 3) and can say that no changes have been made.

Link to comment
Share on other sites

A missing table is definitely worrisome. There may be other tables missing. (The i4558236_cc1 part is very likely the name of your database and is normally included in the report of an error in the query by the database engine.)

 

Link to comment
Share on other sites

With respect to the version of CubeCart you are using, examine the file /setup/db/install/structure.sql.

Note that each table definition starts with CREATE TABLE IF NOT EXISTS. If a table needs to be created, and it already exists, it won't be overwritten.

Go through the list, comparing it with what you see when you use an external database management utility such as phpMyAdmin.

Any table that is missing, copy the CREATE statement to phpMyAdmin's query editor and have it created.

Link to comment
Share on other sites

As I mentioned, if one table is missing, there may be others missing.

However, moving an order to another status is a core function that uses critical tables. If these critical tables were also missing, there would be massive amounts of mayhem occurring.

So, I think getting the database fixed may not actually fix the problem of moving an order to Complete - keeping in mind the order progresses from Pending to Processing just fine.

Link to comment
Share on other sites

  • 2 weeks later...

I tried to create the table and I got this
 

Error
SQL query:


#EOQ
ALTER TABLE `CubeCart_email_log` ADD PRIMARY KEY (`id`)
MySQL said: Documentation

#1146 - Table 'i4558236_cc1.CubeCart_email_log' doesn't exist

When I try to create the

Table 'i4558236_cc1.CubeCart_email_log'

it says that table already exist. How should I address this? Thanks.

This was the code I was trying to use to create the table
CREATE TABLE IF NOT EXISTS `cc_CubeCart_email_log` (
  `id` int(11) NOT NULL,
  `subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `content_html` text COLLATE utf8_unicode_ci NOT NULL,
  `content_text` text COLLATE utf8_unicode_ci NOT NULL,
  `to` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `email_content_id` int(11) NOT NULL,
  `result` tinyint(1) NOT NULL,
  `fail_reason` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; #EOQ
ALTER TABLE `CubeCart_email_log` ADD PRIMARY KEY (`id`); #EOQ
ALTER TABLE `CubeCart_email_log` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; #EOQ

 

Link to comment
Share on other sites

In the file /includes/global.inc.php, there will be a variable for the database table prefix.

Depending what you are using to issue the above SQL statement, you will probably need to prepend that prefix to all table names.

I see the first line uses cc_CubeCart_email_log, but the last two lines do not have the prefix.

Link to comment
Share on other sites

I made the changes as you suggested using the code below :
CREATE TABLE IF NOT EXISTS `cc_CubeCart_email_log` (
  `id` int(11) NOT NULL,
  `subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `content_html` text COLLATE utf8_unicode_ci NOT NULL,
  `content_text` text COLLATE utf8_unicode_ci NOT NULL,
  `to` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `email_content_id` int(11) NOT NULL,
  `result` tinyint(1) NOT NULL,
  `fail_reason` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; #EOQ
ALTER TABLE `cc_CubeCart_email_log` ADD PRIMARY KEY (`id`); #EOQ
ALTER TABLE `cc_CubeCart_email_log` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; #EOQ

And no I'm getting this :
Error
SQL query:


#EOQ
ALTER TABLE `cc_CubeCart_email_log` ADD PRIMARY KEY (`id`)
MySQL said: Documentation

#1068 - Multiple primary key defined

How do I resolve it?

 

Link to comment
Share on other sites

Examine the structure of this table. It may already have a primary key on the column 'id'.

To examine a table structure, you will need to use an external database utility such as phpMyAdmin. This utility is commonly available within the control panel provided by your hosting company for your site.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks Brian, I did that...Now the order status updates to order complete, but for some weird reason, the order complete email notification is sent in a German Language, it's a little confusing since the default language for the store is set to English.
What could be causing that?

 

1879141974_ordercomplete.png.012d046dc55e941e1a9c818e9ff34fe9.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...