Jump to content
Sign in to follow this  
Ferguson230

Order status not changing from Processing to Order Complete

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.

Share this post


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

Share this post


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

Share this post


Link to post
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.)

 

Share this post


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

Share this post


Link to post
Share on other sites

Thanks Bsmither, I'll do that, but I must say I don't have the structure.sql on the server.
I use Cubecart version 6.2.0. If you have that file, can you please attach it?

Share this post


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

Share this post


Link to post
Share on other sites

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

 

Share this post


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

Edited by bsmither

Share this post


Link to post
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?

 

Share this post


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

Share this post


Link to post
Share on other sites

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

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...