I need to create following module on admin page:
1. It must add new table OrderItemActivations to DB, as I understand if my module located in XLite\Module\Romas\ProductActivation I must add ProductActivation.php(with table schema) to XLite\Module\Romas\ProductActivation\Model folder, am I right?
Here is what I write in XLite\Module\Romas\ProductActivation\Model\OrderIt emActivation.php:
PHP Code:
<?php
namespace XLite\Module\Romas\ProductActivation\Model;
class OrderItemActivation extends \XLite\Model\Base\I18n
{
/**
* OrderItemActivation unique ID
*
* @var integer
*
* @Id
* @GeneratedValue (strategy="AUTO")
* @Column (type="integer", options={ "unsigned": true })
*/
protected $activation_id;
/**
* OrderItemActivationn order items
*
* @Column (type="integer", options={ "unsigned": true })
*/
protected $order_item_id;
/**
* OrderItemActivation creation timestamp
*
* @var integer
*
* @Column (type="integer")
*/
protected $date;
/**
* OrderItemActivation credit
*
* @var integer
*
* @Column (type="integer")
*/
protected $credit;
/**
* OrderItemActivation Code
*
* @var string
*
* @Column (type="string", length=255, nullable=true)
*/
protected $activation_code;
/**
* OrderItemActivation ip address
*
* @var string
*
* @Column (type="string", length=255, nullable=true)
*/
protected $ip_address;
}
is class OrderItemActivation extends \XLite\Model\Base\I18n is right?
2. It must add a new tab to order details, I can make it following instructions
http://kb.x-cart.com/display/XDD/Adding+tabs, but instead of decorating \XLite\Controller\Admin\Product I must decorate \XLite\Controller\Admin\Order class.
But also tell me please how to create viewer class for this tab(where must it be located and how to connect this viewer class to template that is used for new tab)?
3. In created tab it must add a form which adds new record to ProductActivation table, how can I create such form, where should be a handler of this form and how should it look? Please clarify