Using the example here as a guide:
http://kb.x-cart.com/display/XDD/Adding+new+property+to+a+product
I've added a new field to the category admin screen to add short descriptions.
My code looks like this:
In XLite/Module/Client/ClientCatsShortDescriptions/Model/CategoryTranslation.php
Code:
namespace XLite\Module\Client\ClientCatsShortDescriptions\Model;
class CategoryTranslation extends \XLite\Model\CategoryTranslation implements \XLite\Base\IDecorator
{
/**
* @Column (type="string", length=255)
*/
protected $shortDescr;
}
In XLite/Module/Client/ClientCatsShortDescriptions/View/Model/Category.php
Code:
namespace XLite\Module\Client\ClientCatsShortDescriptions\View\Model;
class Category extends \XLite\View\Model\Category implements \XLite\Base\IDecorator
{
public function __construct(array $params = array(), array $sections = array())
{
parent::__construct($params, $sections);
$this->schemaDefault += array (
'shortDescr' => array(
self::SCHEMA_CLASS => 'XLite\View\FormField\Textarea\Advanced',
self::SCHEMA_LABEL => 'Short Description',
self::SCHEMA_REQUIRED => false,
),
);
}
}
in my template listing the categories (cut down for clarity)...
Code:
{foreach:getSubcategories(),subcategory}
{subcategory.name}<br>
{subcategory.shortdescr:h}
{end:}
So this works very nicely except in admin the form field for entering the short descriptions is at the bottom of the page.
How can I move it to be above the normal description box?
I tried
Code:
ALTER TABLE `xc_category_translations` MODIFY `shortDescr` VARCHAR(255) AFTER `name`
in the database but it doesn't have any effect.
I guess it's something to do with the module being called last on the page?