Example #1
0
 public function displayColumn($column)
 {
     $post = $this->wp->getGlobalPost();
     if ($post === null) {
         return;
     }
     /** @var Product | Product\Variable $product */
     $product = $this->productService->find($post->ID);
     switch ($column) {
         case 'thumbnail':
             echo ProductHelper::getFeaturedImage($product, Options::IMAGE_THUMBNAIL);
             break;
         case 'price':
             echo ProductHelper::getPriceHtml($product);
             break;
         case 'featured':
             echo ProductHelper::isFeatured($product);
             break;
         case 'type':
             echo $this->type->getType($product->getType())->getName();
             break;
         case 'sku':
             echo $this->getVariableAdditionalInfo($product, 'sku');
             break;
         case 'stock':
             echo $this->getVariableAdditionalInfo($product, 'stock');
             break;
         case 'creation':
             $timestamp = strtotime($post->post_date);
             echo Formatter::date($timestamp);
             if ($product->isVisible()) {
                 echo '<br /><strong>' . __('Visible in', 'jigoshop') . '</strong>: ';
                 switch ($product->getVisibility()) {
                     case ProductEntity::VISIBILITY_SEARCH:
                         echo __('Search only', 'jigoshop');
                         break;
                     case ProductEntity::VISIBILITY_CATALOG:
                         echo __('Catalog only', 'jigoshop');
                         break;
                     case ProductEntity::VISIBILITY_PUBLIC:
                         echo __('Catalog and search', 'jigoshop');
                         break;
                 }
             }
             break;
     }
 }