Jump to content
kymation

[Addon} Theme Switcher

Recommended Posts

Your code now contains this:

 

<script src="[url="view-source:http://cozaki.net/new/%5Burl="][url=[/url]"view-source:http://code.jquery.com/jquery-migrate-1.2.1.min.js"]http://code.jquery.com/jquery-migrate-1.2.1.min.js[/url]"></script>

 

that should be

 

 

<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Another wonderful jQuery bug. Add the fix in this post to your template_top.php, or use the one a few posts down from that.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

I have made your fixes regarding the error message. Now I have the next similar error.

 

MySQL 5.5.32

PHP 5.5.6

 

All checks are green!

 

Warning: Illegal string offset 'id' in D:\xampp\htdocs\shop\includes\modules\header_tags\ht_theme_switcher.php on line 188

 

Thanks in advance for help.

 

Cheers

Amigoo

Share this post


Link to post
Share on other sites

Line 188 in the Theme Switcher module file (version 1.4.2) is:

 

          	 $first = false;

 

There's no 'id' there. It looks like you're using a modified version of Theme Switcher. I'm not going to be much help with that.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello,

 

I have pushed up the three files:

catalog/includes/languages/english/modules/header_tags/ht_theme_switcher.php

catalog/includes/modules/header_tags/ht_theme_switcher.php

catalog/includes/template_top.php

 

Installed Version: osCommerce Online Merchant v2.3.3.4

 

When I click the install button I get:

1364 - Field 'configuration_value' doesn't have a default value

 

insert into configuration ( configuration_title, configuration_key, configuration_group_id, sort_order, use_function, set_function ) values ( 'Version: 1.4.2', 'MODULE_HEADER_TAGS_THEME_SWITCHER_VERSION', '6', '0', '', 'tep_cfg_do_nothing(' )

 

[TEP STOP]

 

Look forward t any help.

Tanks

Share this post


Link to post
Share on other sites

What version of MySQL are you using? It's being pickier than any I have tested on.

 

Try replacing that line with the following:

 

      	 tep_db_query( "insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function ) values ( 'Version: " . $this->version . "', 'MODULE_HEADER_TAGS_THEME_SWITCHER_VERSION', '', '6', '0', '', 'tep_cfg_do_nothing(' ) ");

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim

 

A Similar error followed. (MySQL 5.1.39-community)

 

I used Workbench6 to pull the create script and I see that NOT Null is specified on a lot of the fields.

The DB creation was done by the current OScommerce automatic creation script.

 

I thought about entering '' for configuration_description but then I don't know what would be the appropriate variable to use for date_added

 

1364 - Field 'configuration_description' doesn't have a default value

insert into configuration ( configuration_title, configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function ) values ( 'Version: 1.4.2', 'MODULE_HEADER_TAGS_THEME_SWITCHER_VERSION', '', '6', '0', '', 'tep_cfg_do_nothing(' )

[TEP STOP]

 

CREATE TABLE `configuration` (

`configuration_id` int(11) NOT NULL AUTO_INCREMENT,

`configuration_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

`configuration_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

`configuration_value` text COLLATE utf8_unicode_ci NOT NULL,

`configuration_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

`configuration_group_id` int(11) NOT NULL,

`sort_order` int(5) DEFAULT NULL,

`last_modified` datetime DEFAULT NULL,

`date_added` datetime NOT NULL,

`use_function` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,

`set_function` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,

PRIMARY KEY (`configuration_id`)

) ENGINE=InnoDB AUTO_INCREMENT=280 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

 

 

Thanks,

Dinesh

Share this post


Link to post
Share on other sites

It wouldn't hurt to set a default value for everything except configuration_id. Oh well, try this code:

 

      	 tep_db_query( "insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added ) values ( 'Version: " . $this->version . "', 'MODULE_HEADER_TAGS_THEME_SWITCHER_VERSION', '', '6', '0', '', 'tep_cfg_do_nothing(', now() ) ");

 

I'll go fix the master and upload a change.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

There was a field missing in your script, I have highlighted below.

 

 

However it appears that this issue arises all through the script.

 

I have decided to roll-back and wait for the updated module to be posted because it is disrupting my setup.

 

 

tep_db_query( "insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added ) values ( 'Version: " . $this->version . "', 'MODULE_HEADER_TAGS_THEME_SWITCHER_VERSION', '','', '6', '0', '', 'tep_cfg_do_nothing(', now() ) ");

 

 

1364 - Field 'configuration_title' doesn't have a default value

 

insert into configuration ( configuration_key, configuration_group_id, sort_order, use_function, set_function ) values ('MODULE_HEADER_TAGS_THEME_SWITCHER_JQUERY_TEST', '6', '7', 'tep_jquery_check', 'tep_cfg_do_nothing(' )

 

[TEP STOP]

Share this post


Link to post
Share on other sites

Jim -

I have read all 26 pages of this post, read multiple versions of the install guide, reinstalled osC and have finally gotten most everything correct, except for something that I can't find any reference too. I have updated jquery to 1.11.0 and installed Theme Switcher. My catalog site look completely normal now, but when I click on the Theme Switcher module in the Admin | Modules | Header Tags section, I get the following:

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

 

This is probably something simple, I just can't find it. Please help.

Edited by pedalt

Share this post


Link to post
Share on other sites

That's a fairly generic error message, so I can't just give you a quick fix. There may be more information in your PHP error log. Ask your host if you don't know where that is.

 

It's probably a misplaced file, so check again that you have everything where it is supposed to be.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I installed the theme switcher on newest version of oscommerce

 

Where can i add a theme?

 

I have this:

MODULE_HEADER_TAGS_THEME_SWITCHER_DESCRIPTION

 

Version: 1.4.2

 

 

Enable Theme Switcher

True

 

Sort Order

1

 

Jquery Version

1.7.2

 

Jquery UI Version

1.8.21

 

Theme

redmond

 

 

MODULE_HEADER_TAGS_THEME_SWITCHER_JQUERY_MISSING

 

 

MODULE_HEADER_TAGS_THEME_SWITCHER_JQUERY_UI_MISSING

 

 

[MODULE_HEADER_TAGS_THEME_SWITCHER_THEME_FOUND

 

 

MODULE_HEADER_TAGS_THEME_SWITCHER_THEME_VERSION_MISSING

 

 

MODULE_HEADER_TAGS_THEME_SWITCHER_TEMPLATE_TOP

 

 

MODULE_HEADER_TAGS_THEME_SWITCHER_LANGUAGE_FILE_MISSING

Edited by nomafo

Share this post


Link to post
Share on other sites

I'm going to have to go play with this one. In the meantime, just ignore it or turn off reporting of warnings.

 

Regards

Jim

 

Did anyone fix the line 186 error?

Share this post


Link to post
Share on other sites

Morning Jim

 

I have been stuggling to get the theme switcher to show up in the add Modules side. I have done everything that the instructions have asked. Also I am running OsCommerce 2.3.3.4 and trying to get JQuery 1.10.4 to run.

 

Should I send the header_top file to you or the entire folder (working offline at the moment)

 

Thank you in advance.

Share this post


Link to post
Share on other sites

Do you mean it doesn't show up in the Install list in your Admin? That means you don't have the Catalog side files in the right places.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Evening Jim

 

I have even copied the folder directly into the below files as you have stated. Still get only 5 modules. Is there something I am missing?

 

catalog/includes/languages/english/modules/header_tags/ht_theme_switcher.php

catalog/includes/modules/header_tags/ht_theme_switcher.php

catalog/includes/template_top.php (Delete lines and move lines)

Share this post


Link to post
Share on other sites

Is your store installed in the catalog directory?

 

Log into your Admin, then go to Modules >> Header Tags. Click the Install button. Is Theme Switcher in the list?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I am not following when you say, is the store installed in the catalog directory. I have installed the headers in the correct directory, yet when I go to the admin, modules and install.. it does not show. Should I put a link for the current setup I have? ( you can download it and check but as far as I can see it looks right, might be missing something)

Share this post


Link to post
Share on other sites

I am asking you where your osCommerce store is installed. The default is a directory named catalog, but this is not always the case.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello,

I have the theme switcher installed and have been able to change themes easily. The only issue that I'm having is that clicking on an image in the catalog opens the homepage of my store in another window. Prior to this, clicking on an image would open a larger image box.

 

If I remove the theme switcher module, all goes back to normal. Is this jquery related?

 

I am using Oscommerce 2.3.3.

 

Thanks.

Share this post


Link to post
Share on other sites

That is probably caused by a jQuery version compatibility bug. Try adding the jQuery Migrate plugin to your includes/template_top.php.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×