php - Magento custom order attribute/fields? Shooting myself in the foot? -


i'm building magento store using single catalog on 4 domains: 1 , 3 europe (uk, french, , german). there's 1 fulfillment warehouse in europe, 1 in , sort of unofficial/internal "warehouse" in giveaways , such fulfilled, , not tracking inventory levels in magento. need track particular transaction types plain web sales along internal/admin orders non web sales, giveaways, trade show orders, etc. plan extend core order model , adding kind of "order/transaction type" field , then, upon placement of order, process order data , direct warehouse sent off fulfillment based on store id , 'order type' value.

being new magento, want know if kind of setup bad idea reason. shooting myself in foot? there reason single catalog might problematic? there easier or better way of handling flow? there way add custom attributes orders can products?

you're heading in right direction, (as things magento), there couple of options. important principle here architecture of modifications must not lead situation upgrades/patches on core compromised. what's interesting magento has moved away highly extensible , upgrade-safe (mostly) eav model mage_sales_model_order (and related objects) in current release. makes more difficult add attributes in upgrade-safe manner, imho.

i recommend use observer system add new attribute values, related model. is, rather adding attribute order model itself, create model holds order_id , custom attributes. hook appropriate event (probably sales_convert_quote_to_order orders or checkout_type_onepage_save_order_after frontend orders) , examine quote items set values in custom model. when execute process transmit orders fulfilment house, can lookup custom attributes via order_id.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -