Setting Order as Shipped does not set Order to a Complete status

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Here's the solution I came up with:  I created an update trigger (SQL statement below) on the ORDER table to handle the situation.  

NOTE:  The trigger fires when a user clicks the "Set as Shipped" button on the order->shipping info page...however, the page does not refresh when you click this button, so the button text will change to "Set as Delivered" and not immediately disappear as it does when you click it is "Set as Delivered"...just a note to remember - the button label not changing immediately does not mean your trigger did not fire.  Go back to order list, come back to your order and the button will be gone as it expected.  Also, no "Order Delivered" email is sent to the customer...

Also, the trigger may get deleted if you upgrade to a newer version of nopCommerce down the road, so save the script below!



Here is the SQL query you will need to execute on your database.

-- If the trigger exists with the same name (order_update), delete it first, then re-create it below
IF EXISTS (SELECT name FROM sysobjects
      WHERE name = 'order_update' AND type = 'TR')
   DROP TRIGGER order_update
GO

CREATE TRIGGER order_update
ON [order]
FOR UPDATE
AS
BEGIN
SET NOCOUNT ON;

/* Get the shipping status for the record that is updated. */
DECLARE @shippingstatusid int
DECLARE @orderid int
SELECT @orderid = id, @shippingstatusid = shippingstatusid FROM INSERTED

/*
  If the new shippingstatusid = 30 (Shipped), change the value to 40 (Delivered) instead; also, we need
  to change the order status to "Complete" (30).
*/
IF UPDATE(ShippingStatusID)
BEGIN
  IF @ShippingStatusID = 30
    UPDATE [order] SET ShippingStatusID = 40, OrderStatusID = 30 WHERE id = @orderid
END

END
GO
10 years ago
Hi, I have recently installed 2.8 and upgraded to 3.0. I am not able to set the Order status as Shipped. No button is available on the Shipping Info tab on the order detail page. I logged in as Administrator.
9 years ago
tmcgallagher wrote:
Here's the solution I came up with:  I created an update trigger (SQL statement below) on the ORDER table to handle the situation.  

NOTE:  The trigger fires when a user clicks the "Set as Shipped" button on the order->shipping info page...however, the page does not refresh when you click this button, so the button text will change to "Set as Delivered" and not immediately disappear as it does when you click it is "Set as Delivered"...just a note to remember - the button label not changing immediately does not mean your trigger did not fire.  Go back to order list, come back to your order and the button will be gone as it expected.  Also, no "Order Delivered" email is sent to the customer...

Also, the trigger may get deleted if you upgrade to a newer version of nopCommerce down the road, so save the script below!



Here is the SQL query you will need to execute on your database.

-- If the trigger exists with the same name (order_update), delete it first, then re-create it below
IF EXISTS (SELECT name FROM sysobjects
      WHERE name = 'order_update' AND type = 'TR')
   DROP TRIGGER order_update
GO

CREATE TRIGGER order_update
ON [order]
FOR UPDATE
AS
BEGIN
SET NOCOUNT ON;

/* Get the shipping status for the record that is updated. */
DECLARE @shippingstatusid int
DECLARE @orderid int
SELECT @orderid = id, @shippingstatusid = shippingstatusid FROM INSERTED

/*
  If the new shippingstatusid = 30 (Shipped), change the value to 40 (Delivered) instead; also, we need
  to change the order status to "Complete" (30).
*/
IF UPDATE(ShippingStatusID)
BEGIN
  IF @ShippingStatusID = 30
    UPDATE [order] SET ShippingStatusID = 40, OrderStatusID = 30 WHERE id = @orderid
END

END
GO


HI, Can i use your code above in nopcommerce 3.30?
please help me!
9 years ago
Be careful in a trigger with
  SELECT @var = field FROM INSERTED

SQL Server triggers are statement based, not row based.  INSERTED could have many rows.
9 years ago
Hey guys,

I'm new to NOP and the company I work for, we are a midsize company shipping about 20-100 packages a day depending on the day.  

I'm trying to figure out, who was this "delivered feature" designed for??? I can not see a positive use for this but I believe it is absolutely a bad idea for probably the vast majority of store owners.

You are making yourself look like an idiot to your customers,  we get about 1 in 10 of our customers who call or write demanding to know why their package is not delivered (because it says it is)

Personally I do not like follow up conversations that may turn into a sale when the reason for the call is we goofed up  (talk about losing customer confidence) how many future sales are we LOSING???

I have thought this must have been implemented for very large companies who dynamically interface with the tracking information and all 3 major shippers, and then send it back so there is never manual tracking information entered by a real person, or any shipped or delivered buttons clicked.  

If it wasn't designed for A big technically advanced company,  it seems to be designed for the mom that works at home with 3 shipments a week.  (who actually follows every order)  

Outside of those two scenarios? Who could possibly want this???  I see 0 upside and tons of downside, what business model am I missing?
9 years ago
Simple solution; if you want to keep functionality, let us customize the verbiage used to describe it on the customer order info page?  

Allow "Delivered" to be changed to something like "Complete" or "Shipped" or "left the building" anything other than "Delivered", how about a character limit Text Box?
9 years ago
You can change the content of the email template for ShipmentDelivered.CustomerNotification

You can change the Delivered status text which is localized:

enums.nop.core.domain.shipping.shippingstatus.delivered
7 years ago
New York wrote:
You can change the content of the email template for ShipmentDelivered.CustomerNotification

You can change the Delivered status text which is localized:

enums.nop.core.domain.shipping.shippingstatus.delivered


This seems to be a quick and easy solution for non-programmers, like me.  I also changed the Localized Status text Order.Shipments.DeliveryDate to "Fulfillment Date" so that it appears as "Fulfillment Date" on the customer's Order Info page.  I think it's helpful to "Finalize" an order in some way, whether it's marking it Delivered or shipped in full.  Sometimes I need to split-ship orders,and it's good to be able to mark an order as shipped, but still processing, until shipped in full...which in my case is the "Fulfillment Date".

Thanks for this solution.
4 years ago
Jumping on a really old post - but it's still an issue for me so I'll resurrect it and give my $0.02 USD worth for consideration in a future version:

I totally get why it works the way it works in that an order is really not "complete" until it is "delivered" - our commitment to the customer doesn't end when we hand the box to UPS.  Also, in the rare instances that a box comes back to you - you won't have to adjust the inventory to add the item back to your shelf.

However - I still think it's missing something.  It REALLY needs a 5th Order Status.

Currently, there's Pending, Processing, Complete and Cancelled.  There really should be a "Shipped" status between Processing and Complete.  

That should solve everybody's problem.  

"Shipped" allows customers to view their order online and see the status change so they know the box is on the way.   Also allows store admins to view the order list and quickly see what's Processing but not yet shipped.  And inventory isn't adjusted until the box is actually "Delivered" - which is the end of the order lifespan.

I'm currently updating to 4.2 so a little busy migrating the stores to the new version (coming from 3.7 so I'm a ways behind).   But if I find some time I might look into customizing this in to my version.     I tend to cling to versions for a few years so I'm not worried about having to reintegrate my changes into some future version when I upgrade.  

But what do you all think about making this a default behavior in a future version?   Did I miss a reason not to do it?
4 years ago
There should be a shipped button, I can't see it, I just change to completed.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.