Class ShopgateConfig not found - magento - php

I have installed a custom module in my Magento website but now, when I try to reach the frontend of my website I receive an error. Class 'ShopgateConfig' not found.
PHP Fatal error: Class 'ShopgateConfig' not found in C:\\xampp\\htdocs\\blugento\\.modman\\shopgate_magento_integration\\src\\app\\code\\community\\Shopgate\\Framework\\Model\\Config.php on line 42, referer: blugento.local/index.php/admin/system_config/index/key/....
But the class exists because I found it in one of the module files. This is the code where the class is called:
class Shopgate_Framework_Model_Config extends ShopgateConfig{...}
And there is the implementatin of the class:
class ShopgateConfig extends ShopgateContainer implements ShopgateConfigInterface{...}
Which could be the problem? Do I have to change something in the config.xml file or somewhere to find my class?
If is necessary I'll post more of my code if you'll tell me!
Thank you very much!

Do do refresh the cache ?
Do you see the module enabled in your configuration (system > configuration > advanced > Advanced) ?
What is the exact error you get in your log ?

Well you are on M1 so you need to confirm ShopgateConfig class is on right directory. Magento will show that error when they don't find right path for ShopgateConfig.php file
Can you tell me path of ShopgateConfig file? And from below syntax
class Shopgate_Framework_Model_Config extends ShopgateConfig
I assume if you are calling this file then it must be inside lib folder

Related

Cannot use a custom PHP plugin in Laravel

I have installed a plug-in called tet. I copied tet.so in the plug in folder and included it in php.ini
I have checked phpinfo and says that the plugin is enabled and running.
I have created a php page to test it.
<?php
new tet();
?>
And works perfectly.
However when I try this on my laravel it gives me this error:
FatalThrowableError in mycontroller.php line 16: Class
'App\Http\Controllers\tet' not found
tet is not a controller. Tet is a class created by the php plugin. How do I include this in laravel?
You should try
new \tet();
because you are using it inside a namespace. Inside a namespace any reference to a class is considered as relative to the namespace you are in. With the "\" you can "escape" the namespace and so you can access classes outside.

Drupal 8 autoload don't load custom class

I recently decided to develop a new website with drupal 8 (i never used drupal 7 or other version).
I had to create a module and i need a custom class in this module and i create a service to use it. But i've an error, my custom class is not find.
When i had a require of my class in the autoload.php, it's work. So my service is correct but my class is not include in my autoload.
Anyone have a solution for my problem ?
Do you "use" the class? Like that:
use Drupal\your_namespace\yourClass;
Of course your class needs a namespace to make this work.
you need follow PSR4 rule, if your class is defined in module, you should put your class file into the correct folder structure , for example if your class namespace defined as "Drupal\your_module_name\yourClass" , the file folder structure should be: modules\your module name\src\ (your Class file)

How to solve modules which use overrides are not able to install / uninstall properly in prestshop

I have createsd a new module in prestashop. Here I had overrite some core functionality of product class.
My overrite file has placed in the location : prestashop/modules/mymodule/override/
When I install the module i am getting the following Error :
Cannot redeclare class ProductOverrideOriginal in /var/www/html/htdocs/prestashop/modules/sharesoft_relatedproducts/sharesoft_relatedproducts.php(96) : eval()'d code on line 2
[PrestaShop] Fatal error in module sharesoft_relatedproducts.php(96) : eval()'d :
Cannot redeclare class ProductOverrideOriginal .
How can i fix this
It means jsut what it says. Your code tries to declare a class twice (with the same), so there is a conflict.
I also do not understand why your class is named ProductOverrideOriginal. All Prestashop overrides must override original PrestaShop classes, for example
class Product extends ProductCore { ...
From the error message I presume that you tried to include your overriden class
require('/override/sharesoft_relatedproducts.php');
But all files from module folder
prestashop/modules/mymodule/override/
are automatically copied to
prestashop/override/
during module installation. My guess is that your override class file is copied there, and is loaded, but you also try to include it again in your module, which gives you error (trying to declare twice).
Also, make sure you use statements like:
require_once('myfile.php');
or
if (!class_exists('MyFile'))
require_once('myfile.php');
to ensure that the same class is not declared twice. Seconde option is better because its faster (does not check file system)

Magento theme not working

I have purchased a theme from themeforest and I downloaded the zip file. Then I extracted it according to the documentation along with the zip file. Then I added "app, js, media, skin to the correspondent folders".
Compilation mode is disabled (default). Then I went to admin panel and cleared cache, but when I opened my frontend it shows me an error saying:
Fatal error: Class 'Mage_Jollyanytheme_Helper_Data' not found in C:\wamp\www\magento\app\Mage.php on line 547
I have googled it and referred several questions such as:
Magento Helper Class Not Found Error
Magento : Fatal error: Class 'Mage_Giftcards_Helper_Data' not found in ...../app/Mage.php on line 546
But I could not reveal any useful information from those questions.
How can I sort this out?
Check that in your app/code/local/Jollyanytheme/Helper/Data.php is exists with following code
class Mage_Jollyanytheme_Helper_Data extends Mage_Core_Helper_Abstract
{
}
If not then add it.
I have solved it, I needed to add two file directories that were in different folders. Means in first step I need to install app,js,media,skin etc, and in second step I need to install etc modules also. Thanks guys.

Codeigniter DB Language extension not working

I'm trying to use this extension
But it gives me the following error when loading the library:
Unable to load the requested class: Language
Also if I write MY_Language instead, it gives me the following error:
Fatal error: Class 'CI_Language' not found in C:\wamp\www\ckphp\application\libraries\MY_Language.php on line 79
I am using WAMP and CI v. 2.2.0
Thanks!
I figured it out myself after some more researching...
Apparently the language class is not even in the library folder, but in core folder, meaning it should be placed in the core application/core folder. Also the name is not CI_Language, but CI_Lang, meaning the file name has to be MY_Lang (if MY_ is your prefix). The last thing to change in the extension is
parent::CI_Language();
to
parent::__construct();
and everything should work fine!
Usage:
$this->lang->load('set', 'language'); // To load a language
$this->lang->line('key'); // to display the text
or simply
lang('key'); // if using the language helper
Hope this will help others in the future!
I made a GIST for latest CodeIgniter 3.1.X including with migration to create the database structure
https://gist.github.com/cyberfly/885b320fdf914ae15f7316b22cc72f32

Categories