| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Classes Decorate Issue | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Classes Decorate Issue
I had been trying to decorate both the ShippingAddress and BillingAddress. But the problem is that after deployment I saw in the files /var/run/ that ShippingAddress is extending the BillingAddress. I don't want that way because I want both the ShippingAddress and Billing Address to have independent functionality and functions. Please guide me through what I had been doing wrong here:
namespace XLite\Module\Swipezoom\InternationalShipping\View\ Checkout; /** * Billing address block */ abstract class BillingAddress extends \XLite\View\Checkout\AAddressBlockAbstract implements \XLite\Base\IDecorator { } namespace XLite\Module\Swipezoom\InternationalShipping\View\ Checkout; /** * Shipping address block */ abstract class ShippingAddress extends \XLite\Module\Swipezoom\InternationalShipping\View \Checkout\BillingAddress implements \XLite\Base\IDecorator { } I checked on the getAddressFields() function which is now same for both the classes because of inheritance which has taken place. Please guide me through the correct way to extend these two classes in my plugin without effecting the overall functionality.
__________________
Regards, Aneel Sarwar X-Cart version: 5.2.10 Windows: 7 Modules: Free version modules |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Classes Decorate Issue
I don't see this happening on my local XC5 installation.
Please check whether you extend the correct classes in your custom module.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Classes Decorate Issue
Only changes when making the decorator class is changing the namespace path, adding abstract against the class name and adding 'implements \XLite\Base\IDecorator'? So the class which it was extending it I kept that the same.
Can you please share how you are extending it? Both the source and compiled code for these two classes.
__________________
Regards, Aneel Sarwar X-Cart version: 5.2.10 Windows: 7 Modules: Free version modules |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Classes Decorate Issue
ok. I got this issue fixed. Problem was that I was decorating (extending) the incorrect class. Following is the correct solution, in case someone else is stucked in similar sort of issue:
namespace XLite\Module\Swipezoom\InternationalShipping\View\ Checkout; /** * Shipping address block */ abstract class BillingAddress extends \XLite\View\Checkout\BillingAddress implements \XLite\Base\IDecorator { } namespace XLite\Module\Swipezoom\InternationalShipping\View\ Checkout; /** * Shipping address block */ abstract class ShippingAddress extends \XLite\View\Checkout\ShippingAddress implements \XLite\Base\IDecorator { }
__________________
Regards, Aneel Sarwar X-Cart version: 5.2.10 Windows: 7 Modules: Free version modules |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|