Ehsanai Posted July 30, 2020 Share Posted July 30, 2020 Hi, I've a module for internal link an this module is not working for product descriptions. can somebody tell me that this override is correct or not? PS 1.7.6.1 class ProductController extends ProductControllerCore { public function initContent() { if(Module::isInstalled('g_internallinking') && Module::isEnabled('g_internallinking')) { // overide product content $formObj = Module::getInstanceByName('g_internallinking'); $contents = array( 'description_short'=>$this->product->description_short, 'description'=>$this->product->description, ); $results = $formObj->getContentInternallinking('product',(int)$this->product->id,$contents); $this->product->description = $results['description']; $this->product->description_short = $results['description_short']; //# overide product content } parent::initContent(); } } Link to comment Share on other sites More sharing options...
tomerg3 Posted July 30, 2020 Share Posted July 30, 2020 Did you try to output text, or write to a log to make sure your code is being called? When you are calling parent::initContent(); you are essentially running the same function you are overwriting, and if you are initiating the same variable as the original function, it will overwrite whatever you are doing. Link to comment Share on other sites More sharing options...
Ehsanai Posted July 30, 2020 Author Share Posted July 30, 2020 I don't know exactly. I have problem with module and I think the override is not working well. Do you know the product description override is difference between PS 1.6 and 1.7? the module has the same override for this and I think it's wrong. Link to comment Share on other sites More sharing options...
tomerg3 Posted July 30, 2020 Share Posted July 30, 2020 Overrides work in a similar way. I suggest you contact the module creator and ask for their help Link to comment Share on other sites More sharing options...
Ehsanai Posted July 31, 2020 Author Share Posted July 31, 2020 I can't access to module developer. Quote Did you try to output text, or write to a log to make sure your code is being called? Can you tell me how to I can do it? Link to comment Share on other sites More sharing options...
Knowband Plugins Posted July 31, 2020 Share Posted July 31, 2020 This override file seems correct but this has to be in the override/controllers folder OR modules/modulename/override/controllers (& try resetting the module & cache clear) Link to comment Share on other sites More sharing options...
tomerg3 Posted August 3, 2020 Share Posted August 3, 2020 On 7/30/2020 at 11:35 PM, Ehsanai said: I can't access to module developer. Can you tell me how to I can do it? Do you mean you tried contacting them, and they did not respond? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now