X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   New field in Adress Fields (https://forum.x-cart.com/showthread.php?t=76097)

Soptareanu Alex 03-15-2018 08:03 AM

New field in Adress Fields
 
1 Attachment(s)
Hello I need to add a custom field in Adress Field table. I decorate the
\XLite\Model\AddressField in order to add this new property in AddressField entity and now i'm working in ItemsList Area. I want to be able to modify the value of this property via ItemsList Table.
This is my controller, decorated the original AddressFields :
namespace XLite\Module\Fdmteam\ChExtrafields\Controller;

/**
* Address fields controller
*/
class AddressFields extends \XLite\Controller\Admin\AddressFields implements \XLite\Base\IDecorator
{
/**
* Return the current page title (for the content area)
*
* @return string
*/
public function getTitle()
{
return static::t('Address Fields');
}

protected function doNoAction()
{
// XLite\Module\Fdmteam\ChExtrafields\Model
$_POST['debugg'] = 'Hello from my controller';
}

protected function doActionUpdate()
{
$list = new \XLite\Module\Fdmteam\ChExtrafields\View\ItemsList \Model\Address\Fieldss ;

$list->processQuick();
}
}

The problem is that didn't work make the update nor insert a new field.

tony_sologubov 03-16-2018 03:15 AM

Re: New field in Adress Fields
 
Hello Alex,

Could you please send me your implementation of changes to Model and ItemsList classes?
Basically, if you define Model and ItemsList classes properly, you do not need any code in controller to get items list working.

Tony

Quote:

Originally Posted by Soptareanu Alex
Hello I need to add a custom field in Adress Field table. I decorate the
\XLite\Model\AddressField in order to add this new property in AddressField entity and now i'm working in ItemsList Area. I want to be able to modify the value of this property via ItemsList Table.
This is my controller, decorated the original AddressFields :
namespace XLite\Module\Fdmteam\ChExtrafields\Controller;

/**
* Address fields controller
*/
class AddressFields extends \XLite\Controller\Admin\AddressFields implements \XLite\Base\IDecorator
{
/**
* Return the current page title (for the content area)
*
* @return string
*/
public function getTitle()
{
return static::t('Address Fields');
}

protected function doNoAction()
{
// XLite\Module\Fdmteam\ChExtrafields\Model
$_POST['debugg'] = 'Hello from my controller';
}

protected function doActionUpdate()
{
$list = new \XLite\Module\Fdmteam\ChExtrafields\View\ItemsList \Model\Address\Fieldss ;

$list->processQuick();
}
}

The problem is that didn't work make the update nor insert a new field.



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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.