Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- * Description of Grid
- *
- * @author pramod
- */
- namespace CustomSalesBlockAdminhtmlOrderCreateSearch;
- class Grid extends MagentoSalesBlockAdminhtmlOrderCreateSearchGrid {
- /**
- * Constructor
- *
- * @return void
- */
- protected function _construct() {
- parent::_construct();
- $this->setId('sales_order_create_search_grid');
- $this->setRowClickCallback('order.productGridRowClick.bind(order)');
- $this->setCheckboxCheckCallback('order.productGridCheckboxCheck.bind(order)');
- $this->setRowInitCallback('order.productGridRowInit.bind(order)');
- $this->setDefaultSort('entity_id');
- $this->setUseAjax(true);
- if ($this->getRequest()->getParam('collapse')) {
- $this->setIsCollapsed(true);
- }
- }
- /**
- * Prepare collection to be displayed in the grid
- *
- * @return $this
- */
- protected function _prepareCollection() {
- $attributes = $this->_catalogConfig->getProductAttributes();
- /* @var $collection MagentoCatalogModelResourceModelProductCollection */
- $collection = $this->_productFactory->create()->getCollection();
- $collection->setStore(
- $this->getStore()
- )->addAttributeToSelect(
- $attributes
- )->addAttributeToSelect(
- 'sku'
- )->addStoreFilter()->addAttributeToFilter(
- 'type_id', $this->_salesConfig->getAvailableProductTypes()
- )->addAttributeToSelect(
- 'gift_message_available'
- )->addAttributeToFilter('status', array('eq' => 1));
- $this->setCollection($collection);
- return $this->setCollection($collection);
- }
- }
Add Comment
Please, Sign In to add comment