Example #1
0
 public function __construct($order, $ship = array())
 {
     if (is_array($order)) {
         $this->payment_package = empty($order['payment_plan']) ? '' : (string) $order['payment_plan'];
         $this->payment_plan = $this->payment_package;
         $this->order_name = empty($order['order_name']) ? __("Post ad", ET_DOMAIN) : $order['order_name'];
         $order_id = parent::__construct($order, $ship);
         $this->update_order();
     } else {
         $order_id = parent::__construct($order, $ship);
         $this->_product_id = $order['post_parent'];
         $this->payment_plan = get_post_meta($order, 'et_order_plan_id', true);
         $this->payment_package = get_post_meta($order, 'et_order_plan_id', true);
     }
 }