Need_Shipment Vs Need_Shipping

Can anyone explain these variables in order details?

Documentation isn't very clear.

http://docs.cs-cart.com/4.5.x/developer_guide/api/entities/orders.html#order-details

never mind figured it out after digging around in the functions.

Care to share what you found? Keeps others from having to go get a shovel.

Its pretty convoluted but if you look in fn.cart.php in fn_get_order_info you can see the logic.

need_shipment is set then there are still products that should be sent.

need_shipping means that shipping information is required

its not clear to me how the need_shipping is actually used though.

For my purposes is seemed easier to use the product line information in the order. Each product ordered has the following variables:

shipped_amount -> amount of products that have been shipped

shipment_amount -> amount of products that need to be shipped

amount -> total number of items orders

These are very straight forward in their implementation in the same function so less likely to lead to a misunderstanding.

I think you'll find that many of these type of "flags" stored in order extra data areas are (or have been) used by different parts of the system and by different addons. They have also probably "evolved" over time and many may no longer be used or are down to being used in one use case only. If you plan to rely upon them, make sure you can trace where they're updated from and whether that data is in fact still valid.

IMHO, basic data like: amount, amount_shipped, remaining_to_be_shipped, order_total, total_paid, balance_due should all be "managed" by the core and updated from the various subsystems (payments, shipping, etc.) via an API or system function/class. But there are so many like "display_price", etc. that just seem to make no sense given the current product. Obviously many of the "remainder" values can be computed easily if the supporting data is in fact accurate and consistent.

The actual orders table has grown/flattened over time too and should probably (hopefully) be refactored in V5.

Yeah I am seeing that too. They really need to implement a better change management system. I like cscart but you can see a lot of the bloat from where they were learning as they go.