Extend Address Manager and Item
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 8
- Joined: 17 Aug 2018, 09:18
Extend Address Manager and Item
Hello,
I have to extend some files. I did not find a way to extend Base class
Can you help me with some solution? I need to add "Tax ID" and "Company registration number" in addition to "VAT ID".
I have modified my original files, but that's wrong
Thanks!
I have to extend some files. I did not find a way to extend Base class
Can you help me with some solution? I need to add "Tax ID" and "Company registration number" in addition to "VAT ID".
I have modified my original files, but that's wrong
Code: Select all
vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Customer/Item/Base.php
...
$list['customer.vatid'] = $this->getPaymentAddress()->getVatID();
$list['customer.taxid'] = $this->getPaymentAddress()->getTaxId();
$list['customer.coc'] = $this->getPaymentAddress()->getCoc();
Code: Select all
vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Common/Item/Address/Base.php
...
case $this->prefix . 'vatid': $this->setVatID( $value ); break;
case $this->prefix . 'taxid': $this->setTaxId( $value ); break;
case $this->prefix . 'coc': $this->setCoc( $value ); break;
Code: Select all
vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Common/Item/Address/Standard.php
...
case $this->prefix . 'parentid': $this->setParentId( $value ); break;
case $this->prefix . 'position': $this->setPosition( $value ); break;
case $this->prefix . 'taxid': $this->setTaxId( $value ); break;
case $this->prefix . 'coc': $this->setCoc( $value ); break;
Code: Select all
vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Common/Manager/Address/Base.php
...
$stmt->bind( 2, $item->getCompany() );
$stmt->bind( 3, $item->getCoc() );
$stmt->bind( 4, $item->getTaxId() );
$stmt->bind( 5, $item->getVatId() );
Re: Extend Address Manager and Item
That's one of the problems of OOP, that you can't extend base classes and inherit your changes to the sub-classes. So you have to extend all sub-classes instead.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star