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

New field in Adress Fields

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-15-2018, 08:03 AM
 
Soptareanu Alex Soptareanu Alex is offline
 

Member
  
Join Date: Sep 2016
Posts: 24
 

Default New field in Adress Fields

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.
Attached Thumbnails
Click image for larger version

Name:	Adress Field.PNG
Views:	60
Size:	21.4 KB
ID:	5120  
__________________
alex
Reply With Quote
  #2  
Old 03-16-2018, 03:15 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General 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 09:44 PM.

   

 
X-Cart forums © 2001-2020