![]() |
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. |
Re: Override XCart class from Includes folder?
Could you please explain in details what customization you are trying to implement?
|
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. |
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. |
Re: Override XCart class from Includes folder?
Yes, thanks, decorating that class did the trick. :-)
|
All times are GMT -8. The time now is 09:01 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.