Tutorials
Order – WooCommerce -> Priority
15 min
this guide will guide you through the smooth setup process, enabling efficient orders management for creating a sales order in priority when a new order is processed in woocommerce prerequisites before you begin, ensure the following connections are established connection between engini and priority learn how to connection between engini and woocomerce learn how to add an order updated trigger to get started, add a trigger add a new activity and choose “order updated” trigger of woocommerce click on the ” add condition” button on the left field, select from the drop down the field you want to add the condition on for this process choose the “status” field on the middle field, choose from the drop down the “=” condition click on the right field, and the tooltip will pop up showing the options of the value you can choose choose the “processing” value the workflow will run only if the condition is true repeat on steps 2 5 to add more conditions in addition to the status condition if necessary you can populate the value field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) expression – using https //app archbee com/public/preview ixqqblwfxopjg0nave78y/preview o3kkbgi5xnqf yvnuqkcv#rknxi and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) click on the “next step” button initialize variable now, let’s initialize a variable that will later hold the customer number of the customer in priority choose “initialize variable” action of engini name field click on the empty field and choose from the tooltip a name for the variable for example “customer number” type field choose from the drop down the “string” option click on the “next step” button get items “customers” next, add the “get items customers” action of priority and set up filters add a new activity and choose “get items customers” action of priority click on the “add filter” button to add a filter on the left field, select from the drop down the field you want to add the filter on for this process choose the “e mail address” field on the middle field, choose from the drop down the “=” condition click on the right field, and the tooltip will pop up showing the options of the value you can choose click on “functions” choose the “tolower” function, that converts a string to lowercase letters and returns the new string choose the “email” value from activity 1 as an input repeat on steps 3 5 to add more filters in addition to the first filter you can populate the value field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) expression – using https //app archbee com/public/preview ixqqblwfxopjg0nave78y/preview o3kkbgi5xnqf yvnuqkcv#rknxi and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) enter the number “1” in the on the “top n” field you can red more about the meaning of the “top n” field https //app archbee com/public/preview ixqqblwfxopjg0nave78y/preview 3nsknswrx5urhesrj0d4u#qtzcm create customers in case, no customer was found with the same email as the billing customer’s email create a new customer add a new activity and choose “create customers” action of priority click on the “add fields” button to fill the fields in the “customers” form on the left field, select from the drop down the field you want to populate in the table for this process choose the fields customer name e mail address phone number street address city address (line 2) click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “customer name” field click on the functions choose the concat function which combines two or more strings, or expression text results into a single string on the left side of the comma enter the first name from the billing from activity 1 on the right side of the comma enter ” ” , and add another comma on the right of the second comma enter the last name from the billing from activity 1 for the “e mail address” field click on “functions” choose the “tolower” function, that converts a string to lowercase letters and returns the new string choose the “email” value from the billing from activity 1 as an input for the “phone number” field choose the phone value from the billing from activity 1 for the “street address” field choose the address value from the billing from activity 1 for the “city” field choose the city value from the billing from activity 1 for the “address (line 2)” field choose the address 2 value from the billing from activity 1 repeat on steps 2 4 to add more fields in addition to the fields we already added, if necessary click on the three dots on the right side of the activity block click on “configure run after” option remove the “v” from is successful check box and add the “v” to is failed check box click on the done button hover over the arrow after this activity and click on the “plus” icon repeat the steps 4 7 of https //app archbee com/public/preview ixqqblwfxopjg0nave78y/preview iddu icv6ahcuko tyicl#07c4f set variable in case a customer was found with the same email as the billing customer’s email, populate the number of the customer in the variable you initialized before hover over the arrow that connects “create customers” and “get items customers” click on the plus icon click on the “add as parallel branch” option choose “set variable” action of priority click on the drop down and choose the name you gave the variable you initialize click on the empty field next to the “value” and choose from the tool tip the number of the customer from the get items customers activity click on the “next step” button create sales orders add a new activity and choose the “create sales orders” action of priority click on the “add fields” button to fill the fields in the “sales orders” form on the left field, select from the drop down the field you want to populate in the form for this process choose the fields sales rep order num customer number click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “sales rep order num” field choose the number value from activity number 1 for the “customer number” field choose the variable you initialize few activities before repeat on steps 1 3 to add more fields in addition to the fields we already added, if necessary click on the “next step” button create “shiping address” (subform of “sales orders”) add a new activity and choose the “create “shiping address” (subform of “sales orders”)” action of priority click on the empty field next to “order (sales order)” and a tooltip will pop up showing the options of the value you can choose choose the “sales order” value from “create “sales orders”” activity click on the “add fields” button to fill the fields in the “shiping address” subform on the left field, select from the drop down the field you want to populate in the subform for this process choose the fields street address country city name phone number address (line 2) zip code click on the right field, and a tooltip will pop up showing the options of the values you can choose for the “street address” field choose the address value from the shipping from activity number 1 for the “country” field choose the state value from the shipping from activity number 1 for the “city” field choose the city value from the shipping from activity number 1 for the “name” field click on the functions choose the concat function which combines two or more strings, or expression text results into a single string on the left side of the comma enter the first name from the billing from activity 1 on the right side of the comma enter ” ” , and add another comma on the right of the second comma enter the last name from the billing from activity 1 for the “phone number” field choose the phone value from the shipping (if there is no phone, choose it from the billing) from activity number 1 for the “address (line 2)” field choose the address 2 value from the shipping from activity number 1 for the “zip code” field choose the postcode value from the shipping from activity number 1 repeat on steps 3 5 to add more fields in addition to the fields we already added, if necessary for each loop add a new activity and choose the “for each loop” action of engini click on the empty field next to the data list and choose from the tooltip the array of the line items from activity number 1 click on the “next step” button inside the “for each loop” block create “order items” (subform of “sales orders”) add a new activity and choose the “create “order items” (subform of “sales orders”)” action of priority order field click on the empty field and choose from the tooltip the number of the order from “create “sales orders”” activity click on the “add fields” button to fill the fields in the “order items” subform on the left field, select from the drop down the field you want to populate in the table for this process choose the fields unit price quantity line item (id) order currency click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “unit price” field choose the price value from line items from activity 1 for the “quanity” field choose the quantity value from the line items from activity 1 for the “line item” field choose the sku value from the line items from activity 1 for the “order currency” field choose the currency value from activity 1 repeat on steps 3 5 to add more fields in addition to the fields we already added, if necessary