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

Classes Decorate Issue

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 08-02-2015, 03:18 AM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default 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
Reply With Quote
  #2  
Old 08-03-2015, 03:55 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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
Reply With Quote
  #3  
Old 08-03-2015, 04:02 AM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default 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
Reply With Quote
  #4  
Old 08-03-2015, 09:20 PM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default 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
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev 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 03:36 PM.

   

 
X-Cart forums © 2001-2020