Exemplo n.º 1
0
 /**
  * Returns button for opening order detail popup
  * @param string $href url address where showing order detail is mantained
  * @param YousticeShopOrder $order class with attached data
  */
 public function getOrderDetailButtonInOrdersPageHtml($href, YousticeShopOrder $order)
 {
     if (!trim($this->api_key)) {
         return '';
     }
     if (!$this->is_properly_installed) {
         return '';
     }
     $products = $order->getProducts();
     $product_codes = array();
     foreach ($products as $product) {
         $product_codes[] = $product->getCode();
     }
     $report = $this->local->getOrderReport($order->getId(), $product_codes);
     $order_button = new YousticeWidgetsOrderDetailButtonInOrdersPage($href, $order, $report, $this);
     return $order_button->toString();
 }