Пример #1
0
 /**
  * Finds and fetches all available WordPress users.
  *
  * @return array List of all available users.
  */
 public function findAll()
 {
     if (!$this->fetchedAll) {
         $this->customers = $this->service->findAll();
     }
     return $this->customers;
 }
Пример #2
0
 public function dataBox()
 {
     $post = $this->wp->getGlobalPost();
     /** @var \Jigoshop\Entity\Order $order */
     $order = $this->orderService->findForPost($post);
     $billingOnly = $this->options->get('shipping.only_to_billing');
     $address = $order->getCustomer()->getBillingAddress();
     $billingFields = $this->wp->applyFilters('jigoshop\\admin\\order\\billing_fields', ProductHelper::getBasicBillingFields(array('first_name' => array('value' => $address->getFirstName()), 'last_name' => array('value' => $address->getLastName()), 'company' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getCompany() : ''), 'euvatno' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getVatNumber() : ''), 'address' => array('value' => $address->getAddress()), 'city' => array('value' => $address->getCity()), 'postcode' => array('value' => $address->getPostcode()), 'country' => array('value' => $address->getCountry(), 'options' => Country::getAllowed()), 'state' => array('type' => Country::hasStates($address->getCountry()) ? 'select' : 'text', 'value' => $address->getState(), 'options' => Country::getStates($address->getCountry())), 'phone' => array('value' => $address->getPhone()), 'email' => array('value' => $address->getEmail())), $order));
     $address = $order->getCustomer()->getShippingAddress();
     $shippingFields = $this->wp->applyFilters('jigoshop\\admin\\order\\shipping_fields', ProductHelper::getBasicShippingFields(array('first_name' => array('value' => $address->getFirstName()), 'last_name' => array('value' => $address->getLastName()), 'company' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getCompany() : ''), 'address' => array('value' => $address->getAddress()), 'city' => array('value' => $address->getCity()), 'postcode' => array('value' => $address->getPostcode()), 'country' => array('value' => $address->getCountry(), 'options' => Country::getAllowed()), 'state' => array('type' => Country::hasStates($address->getCountry()) ? 'select' : 'text', 'value' => $address->getState(), 'options' => Country::getStates($address->getCountry()))), $order));
     $customers = $this->customerService->findAll();
     Render::output('admin/order/dataBox', array('order' => $order, 'billingFields' => $billingFields, 'shippingFields' => $shippingFields, 'customers' => $customers, 'billingOnly' => $billingOnly));
 }