firstname = $order->get_shipping_first_name(); $this->lastname = $order->get_shipping_last_name(); $this->company = $order->get_shipping_company(); $this->address1 = $order->get_shipping_address_1(); $this->address2 = $order->get_shipping_address_2(); $this->city = $order->get_shipping_city(); $this->postcode = $order->get_shipping_postcode(); // Soporte para versiones inferiores a Woocommerce 5.6.0 if (version_compare(WC_VERSION, '5.6.0', '<')) { $this->phone = $order->get_billing_phone(); } else { $this->phone = $order->get_shipping_phone() == '' ? $order->get_billing_phone() : $order->get_shipping_phone(); } $this->email = $order->get_billing_email(); $this->dni = get_post_meta($order->get_id(), $NifFieldValue, true); $this->id_country = $order->get_shipping_country(); } public function getDni() { return $this->dni; } }