Closed echantigny closed 10 years ago
If you need to modify an aspect of an extension, you need to copy the ENTIRE extension to /custom/extensions and then make whichever changes you want to it. Then, in your view files, when you call the extension, call the one you changed in /custom/extensions instead.
Since the extension is part of the core system, the order lookup form, I don't feel like this is a really good idea though. That is what I did to make it work, but it doesn't feel right to leave it like that for future updates.
Its not the same thing as editing a core file, simply because the file you are editing is within the /custom/extensions folder. This is essentially the same thing as editing view files as part of a theme. its a copied file from /protected/views-cities and editing under /themes/mytheme/views/myview.php. if you were applying changes to the ACTUAL file in the /protected folder, then yes, this would be a problem. Not as much given the above method.
Ok so here's my try at changing the Order Lookup Form, which of course, doesn't work.
Copied the whole extension from core/protected/extensions/wsborderlookup to custom/extensions/wsborderlookup.
In my template, changed <?php $this->widget("application.extensions.wsborderlookup.wsborderlookup",array()); ?> to <?php $this->widget("custom.extensions.wsborderlookup.Wsborderlookup",array()); ?>
Tried to change and/or add custom.extensions.wsborderlookup.Wsborderlookup to the main.php file with same result.
The alias « custom.extensions.wsborderlookup.Wsborderlookup » is invalid.
Can you dump your include path? It should be in /config/main.php under import.
As I said, tried adding, modifying... same result
// autoloading model and component classes 'import'=>array( 'application.models.', 'application.models.base.', 'application.models.forms.', 'application.components.', 'application.components.wscontrollers.', 'application.helpers.', /'application.extensions.wsborderlookup.Wsborderlookup',/ 'application.extensions.wsshipping.WsShipping', 'application.extensions.wspayment.WsPayment', 'application.extensions.MissingMessages.MissingMessages', 'application.extensions.s3.', 'custom.extensions.', 'custom.extensions.wsborderlookup.Wsborderlookup', 'custom.helpers.', 'custom.models.', 'custom.xml.', 'editable.' //easy include of editable classes ),
I can't tell if the * is missing because of github. I'm assuming all of your includes end in .*
EDIT: Oh, your call to the extension:
<?php $this->widget("custom.extensions.wsborderlookup.Wsborderlookup",array()); ?>
Unless you actually went in and changed the file name as well as its contents, you have a capital in the latter call that shouldn't be there. Both "wsborderlookup" should be lower-case.
Oh wow!!! Thanks so much. It was actually the issue, the capital in Wsborderlookup. Not sure why they are cased differently in the main.php and in the page call, but at least, now it works. Thanks a lot for this one.
Yeah, all the end after . contained stars. Might have something to do with Markdown pulling them out for some reason.
For anyone who is reading, just in case, I also needed to change this in the init() function of the extension Yii::import('custom.extensions.'.get_class($this).'.models.*');
Glad to hear it's working :D On May 26, 2014 1:44 PM, "echantigny" notifications@github.com wrote:
Oh wow!!! Thanks so much. It was actually the issue, the capital in Wsborderlookup. Not sure why they are cased differently in the main.php and in the page call, but at least, now it works. Thanks a lot for this one.
Yeah, all the end after . contained stars. Might have something to do with Markdown pulling them out for some reason.
For anyone who is reading, just in case, I also needed to change this in the init() function of the extension Yii::import('custom.extensions.'.get_class($this).'.models.*');
— Reply to this email directly or view it on GitHubhttps://github.com/lightspeedretail/webstore/issues/615#issuecomment-44207085 .
I want to extend (or overwrite in the custom folder) a model contained in the extensions, more precisely, the Order Lookup form in the sidebar. All I need to do is to add the yii::t() function that the strings because they are missing. I like to avoid making changes to core files but I can't seem to find a way to extend it or to fully copy the model file in the Custom folder, like we currently have to do with the normal model files.