Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

override order list defineColumns method in my module

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-13-2015, 02:52 AM
 
sayanhealth sayanhealth is offline
 

Newbie
  
Join Date: Mar 2013
Posts: 2
 

Default override order list defineColumns method in my module

I need to override defineColumns method in XLite\View\Itemlist\Model\Order\Admin\Search.php.
I added Search.php class to view folder of my module and defined defineColumns method but it does not work. Please tell me how to do this right?
__________________
X-Cart Gold Plus 4.5.4
Reply With Quote
  #2  
Old 09-14-2015, 12:32 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: override order list defineColumns method in my module

What is the source code of your class?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 09-14-2015, 09:17 AM
 
sayanhealth sayanhealth is offline
 

Newbie
  
Join Date: Mar 2013
Posts: 2
 

Default Re: override order list defineColumns method in my module

PHP Code:
<?php
namespace XLite\Module\Romas\NewOrder\View;

/**
 * Search order
 */
class Search extends \XLite\View\ItemsList\Model\Order\Admin\Search
{
    
/**
     * Define columns structure
     *
     * @return array
     */
    
protected function defineColumns()
    {
        return array(
            
'orderNumber' => array(
                static::
COLUMN_NAME     => static::t('Order #'),
                static::
COLUMN_LINK     => 'order',
                static::
COLUMN_SORT     => static::SORT_BY_MODE_ID,
                static::
COLUMN_ORDERBY  => 100,
            ),
            
'date' => array(
                static::
COLUMN_NAME     => static::t('Date'),
                static::
COLUMN_TEMPLATE => $this->getDir() . '/' $this->getPageBodyDir() . '/order/cell.date.tpl',
                static::
COLUMN_SORT     => static::SORT_BY_MODE_DATE,
                static::
COLUMN_ORDERBY  => 200,
            ),
            
'profile' => array(
                static::
COLUMN_NAME     => static::t('Customer'),
                static::
COLUMN_TEMPLATE => $this->getDir() . '/' $this->getPageBodyDir() . '/order/cell.profile.tpl',
                static::
COLUMN_NO_WRAP  => true,
                static::
COLUMN_MAIN     => true,
                static::
COLUMN_SORT     => static::SORT_BY_MODE_CUSTOMER,
                static::
COLUMN_ORDERBY  => 300,
            ),
            
'paymentStatus' => array(
                static::
COLUMN_NAME     => static::t('Payment status'),
                static::
COLUMN_CLASS    => 'XLite\View\FormField\Inline\Select\OrderStatus\Payment',
                static::
COLUMN_SORT     => static::SORT_BY_MODE_PAYMENT_STATUS,
                static::
COLUMN_ORDERBY  => 400,
            ),
            
'shippingStatus' => array(
                static::
COLUMN_NAME     => static::t('Shipping status'),
                static::
COLUMN_CLASS    => 'XLite\View\FormField\Inline\Select\OrderStatus\Shipping',
                static::
COLUMN_SORT     => static::SORT_BY_MODE_SHIPPING_STATUS,
                static::
COLUMN_ORDERBY  => 500,
            ),
            
'deliveryType' => array(
                static::
COLUMN_NAME     => 'Delivery type',
                static::
COLUMN_TEMPLATE => 'modules/Romas/NewOrder/delivery_type.tpl',
                static::
COLUMN_ORDERBY  => 550,
            ),
            
'total' => array(
                static::
COLUMN_NAME     => static::t('Amount'),
                static::
COLUMN_TEMPLATE => $this->getDir() . '/' $this->getPageBodyDir() . '/order/cell.total.tpl',
                static::
COLUMN_SORT     => static::SORT_BY_MODE_TOTAL,
                static::
COLUMN_ORDERBY  => 600,
            ),
        );
    }
}
__________________
X-Cart Gold Plus 4.5.4
Reply With Quote
  #4  
Old 09-23-2015, 03:31 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: override order list defineColumns method in my module

Do you want create a new class, or modify the existing one?

If these changes are for the existing class, you should add the "implements" part to the class declaration:
PHP Code:
...
class 
Search extends \XLite\View\ItemsList\Model\Order\Admin\Search implements \XLite\Base\IDecorator
... 
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:39 AM.

   

 
X-Cart forums © 2001-2020