| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Override XCart class from Includes folder? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Override XCart class from Includes folder?
I have learned how to add module classes to override and/or depend on other modules and the classes in the classes/XLite directory, per the instructions in the knowledge base:
http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes http://kb.x-cart.com/display/XDD/Making+one+module+depend+on+another+one+--+creating+a+menu+in+the+customer+area For example, I have successfully overridden \XLite\View functionality such as: PHP Code:
However, I have not been able to figure out how to override classes in the Includes/Utils directory. For example, I have tried something like this: PHP Code:
But it has no effect on the storefront, so this class function is apparently not being called.
__________________
X-Cart Business 5.2.13 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Override XCart class from Includes folder?
Could you please explain in details what customization you are trying to implement?
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#3
|
|||||||
|
|||||||
Re: Override XCart class from Includes folder?
I'm trying to modify the storefront url structure, as the default cleanUrl feature doesn't suit my needs. I've managed to created a working solution by hacking the \Includes\Utils\Converter class function buildURL() itself, but I figured a more sustainable approach should be to try to override the function.
Now I see that function is only directly called from \XLite\Core\Converter.php, so I'll try overwriting that class.
__________________
X-Cart Business 5.2.13 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Override XCart class from Includes folder?
XC5 allows you to "decorate" classes in the "classes" directory only. You're right - it doesn't work with classes inside the Includes directory.
The \XLite\Core\Converter class will likely work in your case.
__________________
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 |
|||||||||
#5
|
|||||||
|
|||||||
Re: Override XCart class from Includes folder?
Yes, thanks, decorating that class did the trick.
__________________
X-Cart Business 5.2.13 |
|||||||
|
|||
X-Cart forums © 2001-2020
|