Hi. Recently I started studying zenphoto plugins, My attempt is to integrate zenphoto with zencart,
Well but, i'm already blocked in the first steps of this process. because when I tried to create an example plugin I'm facing a problem. Probably i'm jumping some important step in the basics of plugin creation.
My problem is: after created, included in the directory plugins, my plugin file zenCart.php is discovered by zenphoto and appears in the configuration page. Bu when i tried to enable it (i clicked in the checkbox. etc. ) everything appear to be ok, but in fact it`s not enabled. when i execute an reload the checkbox appears unchecked again.
somebody can help me, please.
Regards from Brazil.
A.
Comments
In the server logs I didn't find any useful info.
I'm didn't checked the zenphoto logs. Actually... has it logs? I tried to find it, but I can't.
Well, my code started getting the paypal plugin and exchanged every point where i have an 'paypal' string to 'zenCart' string. The file names are modified too. It was my first attempt and didn't work.
Then I started cutting the code. And did tests with the same paypal modified files cutting all the code mantaining only the headers with plugin informarmation (author, version, etc). Didn't work too. after save checking the plugin option it dissapeared after a page reload.
In my last test I just created a new file zenCart.php in the plugin directorie and tried to check and save the configuration. failed too.
Do you know if there are a plugin template? an skeleton to be used to plugin developers?
thanks in advance.
A.
here's a sample (very simple) of the code from zenCart.php. With this example I have the option to enable the plugin, but after the the option is saved and a reload in the page is done the checkbox appears unchecked.
<?php
$plugin_description = gettext("zenCart Integration Plugin");
$plugin_author = "Anderson Astor Schwingel";
$plugin_version = '0.1';
$plugin_URL = "";
$option_interface = new zenCartShowOptions();
/**
* Plugin option handling class
*
*/
class zenCartShowOptions{
function zenCartShowOptions() {
}
}
?>
I'm not sure why it do not work with the short name zenCart.
Tryed with other names... like abc.php and worked well to. Just the zenCart appear to fail.
Anyway, thanks for the help. Regards
I'm not sure why it do not work with the short name zenCart.
Tryed with other names... like abc.php and worked well to. Just the zenCart appear to fail.
Anyway, thanks for the help. Regards
`
class zencart {
functions zencart() {
(...)
}
function getOptionsSupported() {
(...)
}
function handleOption($option, $currentValue) { // optional
}
} // class end
// here follow your actual plugin functions
`
Take a look at some simpler plugins like paged_thumbs for example.
Edit: Ok, glad you managed it.
I check a plugin, click save and when I come back to the plugins page it is unchecked again. I didn't find anything in the server log.
Ideas?