예제 #1
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
  * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\GiftMessage\Helper\Message $messageHelper
  * @param \Magento\Checkout\Helper\Data $checkoutHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, \Magento\Framework\Registry $registry, \Magento\GiftMessage\Helper\Message $messageHelper, \Magento\Checkout\Helper\Data $checkoutHelper, array $data = [])
 {
     $this->_checkoutHelper = $checkoutHelper;
     $this->_messageHelper = $messageHelper;
     parent::__construct($context, $stockRegistry, $stockConfiguration, $registry, $data);
 }
 /**
  * @param \Magento\Framework\DataObject|Item $item
  * @param string $column
  * @param null $field
  * @return string
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function getColumnHtml(\Magento\Framework\DataObject $item, $column, $field = null)
 {
     $html = '';
     switch ($column) {
         case 'product':
             if ($this->canDisplayContainer()) {
                 $html .= '<div id="' . $this->getHtmlId() . '">';
             }
             $html .= $this->getColumnHtml($item, 'name');
             if ($this->canDisplayContainer()) {
                 $html .= '</div>';
             }
             break;
         case 'status':
             $html = $item->getStatus();
             break;
         case 'price-original':
             $html = $this->displayPriceAttribute('original_price');
             break;
         case 'price':
             $html = $this->displayPriceAttribute('price');
             break;
         case 'tax-amount':
             $html = $this->displayPriceAttribute('tax_amount');
             break;
         case 'tax-percent':
             $html = $this->displayTaxPercent($item);
             break;
         case 'discont':
             $html = $this->displayPriceAttribute('discount_amount');
             break;
         default:
             $html = parent::getColumnHtml($item, $column, $field);
     }
     return $html;
 }
예제 #3
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\CatalogInventory\Service\V1\StockItemService $stockItemService
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\GiftMessage\Helper\Message $messageHelper
  * @param \Magento\Checkout\Helper\Data $checkoutHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Service\V1\StockItemService $stockItemService, \Magento\Framework\Registry $registry, \Magento\GiftMessage\Helper\Message $messageHelper, \Magento\Checkout\Helper\Data $checkoutHelper, array $data = array())
 {
     $this->_checkoutHelper = $checkoutHelper;
     $this->_messageHelper = $messageHelper;
     parent::__construct($context, $stockItemService, $registry, $data);
 }