Hah, no worries!
If you don't throw those extra values (and add them into a few files which I will explain in a bit) you could run into problems when you want to load specific orders, search by status, etc. So if you open up that init.php file and scroll down a little, you can see these couple lines...
Code: Select all
define('ORDER_STATUS_INCOMPLETE', 0);
define('ORDER_STATUS_PENDING', 1);
define('ORDER_STATUS_SHIPPED', 2);
define('ORDER_STATUS_PARTIALLY_SHIPPED', 3);
define('ORDER_STATUS_REFUNDED', 4);
define('ORDER_STATUS_CANCELLED', 5);
define('ORDER_STATUS_DECLINED', 6);
define('ORDER_STATUS_AWAITING_PAYMENT', 7);
define('ORDER_STATUS_AWAITING_PICKUP', 8);
define('ORDER_STATUS_AWAITING_SHIPMENT', 9);
define('ORDER_STATUS_COMPLETED', 10);
define('ORDER_STATUS_AWAITING_FULFILLMENT', 11);
These are the default constants that Interspire uses for its ordering statuses. If you take a look and compare this data to the default database values, you can see that they actually align. For example, "ORDER_STATUS_AWAITING_FULFILLMENT" has an index value of 11. If you pop into the database, you'll notice that the 11th value is "Awaiting Fulfillment". This just goes to show that there
is a relationship between both the statuses found in the code and those found in the database.
Anyway, if you want to add in your own values to the code, such as "ORDER_STATUS_PACKAGE_LOST" or something like that, you could just add:
Code: Select all
define('ORDER_STATUS_PACKAGE_LOST', 12);
and you'd be all set.
Now, let's say we wanted to actually USE these new values. A good example is to check out the admin backend dashboard and view some of it's magic. If you notice, the dashboard shows some of your recent orders and the status of that particular order. If we open up the "/admin/includes/classes/class.index.php" file and check out the "LoadRecentOrders()" function, we can see the following switch statement:
Code: Select all
// Determine which statuses we'll be showing orders for. Will be used in the query.
switch($status)
{
case 'pending':
$statusIn = array(
ORDER_STATUS_PENDING,
ORDER_STATUS_PARTIALLY_SHIPPED,
ORDER_STATUS_AWAITING_PAYMENT,
ORDER_STATUS_AWAITING_SHIPMENT,
ORDER_STATUS_AWAITING_FULFILLMENT,
ORDER_STATUS_AWAITING_PICKUP,
);
break;
case 'completed':
$statusIn = array(
ORDER_STATUS_SHIPPED,
ORDER_STATUS_COMPLETED
);
break;
case 'refunded':
$statusIn = array(
ORDER_STATUS_REFUNDED,
ORDER_STATUS_CANCELLED
);
break;
default:
$status = 'recent';
}
Just as the comment says, this block determines which statuses you will be accessing to show orders for. So if any of your new statuses falls into the categories of "pending", "competed" or "refunded" then you can simply add in the constant value right there and you'll be right as rain. If all goes to plan, this should pull your orders for those order statuses. Please keep in mind, i have no actually tested this, but based on what I have looked around with, this should work perfectly fine. I'll try and do some testing when I get a chance later on.
There are seriously a lot of different things you can do with statuses, and this is only the tip of the iceberg. Just for kicks, if you look the "/lib/orders.php" file, you can do some simple searches for keyword constants like "ORDER_STATUS_COMPLETED" and you'll see a lot of the ways that Interspire uses constants to determine things like whether or not an order is complete, digital orders, etc.
Hope this helps ya!