I'm developing a dropship extension. Everything is going really well. The integration so far is seamless. I've added a column to sales_flat_shipment_item, called 'dropshipped'. Boolean data, defaults to false. This way normal shipments do their thing the same way as always, but a dropshipped item has this extra flag. So, when I choose to 'Submit Dropship', how can I attach this custom field to the save?
I have used proper extends calls to use the same system as the normal Order->Shipment workflow. So, when a use clicks submit, it is effectively all the same class as a normal Shipment submit. (Mage_Adminhtml_Sales_Order_ShipmentController)
I have tried to add the new field to my global fieldset, as shown below.
<fieldsets>
<sales_order_shipment>
<dropshipped>
<to_shipment_item>*</to_shipment_item>
</dropshipped>
</sales_order_shipment>
</fieldsets>
I am fairly certain something about this config.xml entry is wrong.
So, the new column is called 'dropshipped'. It is a boolean, by default false. This way, when the user executes a normal shipment, all the regular functions work normally. Now, on a dropship, I want to set this field to 'true', or 1. For example:
$shipment->setDropshipped(1);
or
$shipment->setData('dropshipped', 1);
In my custom controller,
Namespace_Module_Adminhtml_Sales_Order_DropshipController extends Mage_Adminhtml_Controller_Sales_Shipment
The code is a copy of Mage_Adminhtml_Sales_Order_ShipmentController except for some descriptive text changes ('shipment' changed to 'dropship' in messages that the user sees) and a couple routing changes to support my custom routes. In other words, saveAction and _initShipment are unchanged from the Mage core.
My theory is that this is the simplest, most straightforward solution to implementing dropshipping. One field that flags a sales_flat_shipment_item record as 'dropshipped' is elegant and simple. So far, my module works with Magento rather than against it, and I'm pretty happy with it.
I'm sure the solution is fairly straightforward, my config.xml might be setup incorrectly, and I'm looking forward to a bit of assistance. Thanks!