Fix hidden metadata

This commit is contained in:
Almira Krdzic
2018-11-18 22:10:01 +01:00
parent 3708c9fb30
commit ef5cf00983
5 changed files with 61 additions and 53 deletions

View File

@@ -88,12 +88,15 @@ class Wiaas_Delivery_Process_Step_Assignee {
$mapped_assignees = array();
$order_id = self::get_order_id_for_step($step);
$order_id = self::_get_order_id_for_step($step);
$order = wc_get_order($order_id);
foreach ($assignees as $assignee) {
/**
* Handle step assignee for installation company field
*/
if (strpos($assignee->get_type(), 'wiaas_installation_') !== false) {
$item_id = $assignee->get_id();
@@ -120,11 +123,15 @@ class Wiaas_Delivery_Process_Step_Assignee {
continue;
}
/**
* Handle step assignee for order role
*/
if ($assignee->get_type() === 'wiaas_order_role') {
$order_role = $assignee->get_id();
// Assign step to order customer
if ($order_role === 'customer') {
$customer_user_id = $order->get_customer_id();
@@ -157,7 +164,7 @@ class Wiaas_Delivery_Process_Step_Assignee {
* @return bool|int Order id on success, false if step does not have associated order id
*
*/
public static function get_order_id_for_step(Gravity_Flow_Step $step) {
private static function _get_order_id_for_step(Gravity_Flow_Step $step) {
$entry = $step->get_entry();