I need to mark specific line items of an order as "shipped" through my programming code. Certain products I sell will be processed and generated electronically, so no physical shipment will occur.
I'd like to write my processing routine so that it can scan for what hasn't been processed, do the work, then mark the item as processed/shipped.
I see how I can grab the orders from ac_Orders. I can grab the line items from ac_OrderItems and tie to the product template responses in ac_OrderItemInputs using the OrderItemID and OrderId values.
Any suggestions on this or a direction you could point me towards?
Best way to update line item shipments through code?
Best way to update line item shipments through code?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Hello,
First I would suggest that for items that are not shippable you simply set them as not shippable in Product edit screen. This should solve your problem. You do not have to mark them shipped manually or with a script.
If you still want to have these items remain shippable and mark their status shipped using a script then you can do something like this
First note that you do not mark order items as shipped ... you mark the shipments as shipped.
Load the Orders that you want to process... For this purpose check the methods in OrderDataSource. You can load all orders or you can load selected orders based on some criteria.
for each order loop the shipments for each order ... then it is upto you to decide which shipments you want to set as shipped. After making the change just call shipment.Save() method.
Thanks,
Sohaib
First I would suggest that for items that are not shippable you simply set them as not shippable in Product edit screen. This should solve your problem. You do not have to mark them shipped manually or with a script.
If you still want to have these items remain shippable and mark their status shipped using a script then you can do something like this
First note that you do not mark order items as shipped ... you mark the shipments as shipped.
Load the Orders that you want to process... For this purpose check the methods in OrderDataSource. You can load all orders or you can load selected orders based on some criteria.
for each order loop the shipments for each order ... then it is upto you to decide which shipments you want to set as shipped. After making the change just call shipment.Save() method.
Thanks,
Sohaib
Already have the nonshippable items marked as such, so I'm ok there.
My situation is unique in that some line items on an order will be physical product that require shipment, while others will be electronically processed and delivered via email attachment.
So I need to figure out an effective way to mark the electronically-processed line items as "done" once I've processed them, without marking the entire order as complete. Conversely, this gives me the ability to filter for the unprocessed ones so I know which ones still need to be handled.
Almost sounds like I should make them "shippable" and just ship them as they are electronically processed.
Thoughts?
My situation is unique in that some line items on an order will be physical product that require shipment, while others will be electronically processed and delivered via email attachment.
So I need to figure out an effective way to mark the electronically-processed line items as "done" once I've processed them, without marking the entire order as complete. Conversely, this gives me the ability to filter for the unprocessed ones so I know which ones still need to be handled.
Almost sounds like I should make them "shippable" and just ship them as they are electronically processed.
Thoughts?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com