Custom Data Fields and Custom Logic for Order Status Based Custom Fields

Job ID: 32996718

Budget: €50 – €400 EUR

We want to add custom data fields in Woocommerce to products but require custom logic to do calculations based on which fields present within the products for an order to return different value depending on values.
This is to cover which labels we need for our small products courier.

So example is
Product 1 requires 1 * SY Label (label system used by courier)
Product 2 requires 1 * VY Label
Product 3 requires 1* SY Label + 1 JY Label
Product 4 can't be sent via small courier so needs custom field called Large Courier
Product 5 is shipped directly by supplier so needs custom field called Direct Courier
Product 6 has no assigned custom field returns review(most likely new product and forget to add data)

So if someone just orders 1 product it will simply return the custom field revelant to Product as per above.
However we then require logic to work out if someone orders different products on same order.

1. If the order contains any product with custom field of Large Courier then value needs to return Large Courier in custom field and ignore other values(or return it in diff final output field and must be pul lable by Zapier) . This is because if 1 product too large to go with smaller courier we just deliver them all together with 1 larger courier as opposed to sending half with small and half larger (costly).

2. If the order contains Direct courier and labels (but not Large Courier) it needs to return label values + Direct Courier in custom field. So staff know their is something to be shipped directly from supplier + with small courier.
3. There is further complex bit which can be discussed with suitable candidate. Which is basically:
If there quantity 2-5 labels if returns in loop.
2 products with 4 labels required (1sy + 1jy + 1sy + 1jy) it returns new value of (1 SY + 3JY) This is complex bit as if 2 or more boxes going to same house we use multi labels for same address.
So even though customer might order 3 products with 3 SY(1 per product) value to return would be 1SY +2JY
It loops in 5 though:
3 labels go to (1sy +2jy)
4 labels go to (1sy+3jy)
5 labels go to (1sy+4jy)
6 labels go to (2 sy+4jy) this is where loop changes to go extra sy instead of 1+5!
7 labels go to (2 sy + 5jy)
8 labels go to (2sy +6jy)
9 label go to (2sy +7jy)

So while it sounds extremely complex someone with understanding of logic should hopefully be able to logic to cover this. If broken down into stages should be easy to do most of it bar last stage!
Related categories: PHP WordPress Software Architecture MySQL Weblogic