Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon} Theme Switcher


kymation

Recommended Posts

Hey kymation... I have a question... How can i do to you ThemeSwitcher don't are in Header Tags, but in a Group with name Theme Switcher. ???.... i will have you ThemeSwitcher from the header_tags folder to a folder name theme_switcher... i have this folder now with "admin theme switcher" so i have both theme switcher same Places...Hope you can and will help me.....

Edited by TheExterminator
Link to comment
Share on other sites

The theme is a header tag, so it makes sense for Theme Switcher to be in the Header Tags group. Feel free to move it if you want to.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

First, I appreciate all the hard work I've seen in installing two other of your contributions. Everything is laid out well and the documentation prepared was a showing of sincerity. Regardless, I manually install everything as I can not blindly trust copying over core files. I did find some inconsistencies in the other two (Modular SEO Header Tags and Modular Front Page) where the versions included would have overwritten some of the 2.3.3 changes, as such, I know the manual method is the only way for me to go.

 

Now, I did noticed a few problems in the included version of: /includes/template_top.php

 

First, per your instructions, the default links to the redmond css and the jQuery libraries are to be removed (3 lines in total). This ignores the possibility that if the header_tag is set to be inactive, and then there wouldn't be any jQuery libraries loaded. In essence, there should be a if block in which the standard 3 lines should be used.

 

I suppose while at it, it probably would be good to have a fail safe condition to check for - whether the jQuery libraries are accessible via this contribution or not.

 

Pseudo-code! Don't Use this.

if (theme_switcher_active === false || theme_switcher_found_jquery_libraries === false) {
?>
<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.22.css" />
<script type="text/javascript" src="ext/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script>
<?php
}

 

 

Second, there is a potential JS error ($ is not defined) since the jQuery libraries are not loaded prior to the 'JQUERY_DATEPICKER_I18N_CODE' conditional block. If JQUERY_DATEPICKER_I18N_CODE is not null, then something would break.

 

Here is the revised version of /includes/template_top.php that I used. I haven't done any code searches to figure out what would need to be checked for the conditional block for default/fail-safe jQuery above, so I'm trusting at this stage that it won't be an issue.


<?php
/*
 $Id$
 $Mod: Theme Switcher 1.4.1 20120828 Kymation $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2012 osCommerce

 Released under the GNU General Public License
*/

 $oscTemplate->buildBlocks();

 if (!$oscTemplate->hasBlocks('boxes_column_left')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }

 if (!$oscTemplate->hasBlocks('boxes_column_right')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
<?php
if (some_yet_to_be_determined_condition === false) {
?>
<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6.css" />
<script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script>
<?php
}
?>

<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<?php echo $oscTemplate->getBlocks('header_tags'); ?>

<script type="text/javascript">
// fix jQuery 1.8.0 and jQuery UI 1.8.22 bug with dialog buttons; http://bugs.jqueryui.com/ticket/8484
if ( $.attrFn ) { $.attrFn.text = true; }
</script>
<?php
 if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {
?>
<script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>
<script type="text/javascript">
$.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);
</script>
<?php
 }
?>

<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />
<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
</head>
<body>

<div id="bodyWrapper" class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?>">

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate->getGridColumnWidth() : ''); ?>">

Edited by HowdyMedia
Link to comment
Share on other sites

Thanks for the bug reports and for the code. I can't think of everything, so having others spot errors/improvements is always valuable -- and very much appreciated.

 

I can test for the existence of the ht_theme_switcher class to check if Theme Switcher exists, then check if it is enabled, and include the default jQuery files if it is not. Now I just need to make the time to test this and release an updated package.

 

Regards

Jim

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

Link to comment
Share on other sites

hi there,i have recently set this up on a friends site,iv followed the instructions and all is working..except when i go into admin and change the theme from the drop down box the only one that works is redmond,i downloaded the theme pack from themerollwer and uploaded all files to the same places etc but i just get the css error The theme CSS file is the wrong version or missing! i have read the instruction pdf again and i just dont see what it is i have to do to make them run im probably having a very blond moment lol any help would be great please i apoligise if this has already been covered.in the pdf it says about updating the theme file how is this done??

Link to comment
Share on other sites

  • 4 weeks later...

I've installed a fresh copy of OSC 2.3.3, and installed Themeswitcher over it, on the admin everything is ok, however, i'm trying to use the live version with the developertool.php and the pop up windows (i guess this should show all the jquery buttons, fonts, colors, etc) gives me a 404 error not found...

 

i checked every link and modify to the new versions, however it still show the 404 error, here is my website link to test

 

http://www.doralworld.com/oscommerce/catalog

 

any help would be really appreciated!

Link to comment
Share on other sites

The jQuery team stopped supporting the dev tool months ago, and now they've removed the code from their website. You'll have to design your theme on the jQuery website.

 

Regards

Jim

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

Link to comment
Share on other sites

hi

 

i followed all of your directions and uploaded the files to my server but when I go to the header tags module and try to add on the theme switcher the page gives me this message:

 

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/45/d147136459/htdocs/fbfooddrive/catalog/includes/modules/header_tags/ht_theme_switcher.php

 

 

what have I done wrong?

 

Thanks

Link to comment
Share on other sites

Trying to make theme switcher 1.4.1 work on a fresh install of osc 2.3.3

Had all green checkmarks on first install, green checkmarks on updating jQuery to 1.8.3

Error comes when I try to change Jquery UI Version 1.8.22 to 1.9.2 - The theme CSS file is the wrong version or missing!

When I try to install a new theme. I am finding that no theme that I download, including Redmond, has the themes/redmond/jquery-ui-###.custom.css

None of them have any "custom" files, only the .zip file contains the word custom.

Upload a new theme, even though there is no "custom" file and I get the same error The theme CSS file is the wrong version or missing!

 

Am I doing something wrong?

 

I also find there is no option "Select the highest version number available in the radio buttons below the pulldown." on http://jqueryui.com/download/

 

Thanks for any help offered!

Link to comment
Share on other sites

The jQuery websites have been redesigned, and the filenames have also been changed. The changes are:

 

1. The jquery-###.min.js jQuery file is no longer supplied. You can use the jquery-###.js file instead and rename it.

 

2. The jquery-ui-###.custom.min.css file is now named jquery-ui.css. Rename it to jquery-ui-###.css. The version number must match the version number of the jQuery UI Javascript file.

 

3. There is no longer an option to select the version on the jQuery UI download page, and the controls have been moved to the bottom of the page.

 

Regards

Jim

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

Link to comment
Share on other sites

I have been having issues after installing theme switcher.

 

in the admin screen, I can select a theme, which seems to partly work, however i get errors in the admin scrren that look like this:

 

Warning: Illegal string offset 'id' in C:\wamp\www\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 159 Call Stack # Time Memory Function Location 1 0.0016 226568 {main}( ) ..\modules.php:0 2 0.0578 1298568 tep_call_function( ) ..\modules.php:264 3 0.0578 1298664 call_user_func ( ) ..\general.php:1281 4 0.0578 1298680 tep_jquery_check( ) ..\general.php:1281 5 0.0580 1298768 tep_get_directory_list( ) ..\ht_theme_switcher.php:292 6 0.0591 1300144 array_msort( ) ..\ht_theme_switcher.php:225

 

There is about 15 of those errors one after the other

 

Any Ideawhat the issue is??

 

 

 

:EDIT:

 

 

Sorry about the formation of that error data, The error shows up in a table in the admin screen with a bright orange header if that helps.

 

I also get erros down right hand side saying:

Version: 1.4.0

 

 

Enable Theme Switcher

True

 

Sort Order

1

 

Jquery Version

1.9.2

 

Jquery UI Version

1.9.2

 

Theme

MDI-Custom

 

 

cross.gifThe jQuery file is missing!

 

 

cross.gifThe jQuery UI file is missing!

 

 

tick.gifThe selected theme was found.

 

 

cross.gifThe theme CSS file is the wrong version or missing!

 

 

tick.giftemplate_top.php has been modified.

 

 

tick.gifThe language file was found.

Edited by Djinne
Link to comment
Share on other sites

I've uploaded a new version to the Addons area. There is no functional change in the Theme Switcher module, so no need to update if yours is running now. I did update the User's Manual to include the changes to the jQuery website, and to remove references to the (now-deceased) Dev Tool.

 

The package in the Addons section is missing the jQuery files, since that package is too large to upload without approval. If you want the whole thing, it's available from my server. Or you could follow the instructions and download the missing files straight from the jQuery site. Your choice.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Hi!

First of all, thanks for a brilliant add-on :thumbsup:

I have however come across a slight problem. When I change the language of my site I get these errors at the top of my page:

 

Warning: include(includes/languages/danish/modules/header_tags/ht_theme_switcher.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\catalog\includes\classes\osc_template.php on line 86

 

Warning: include() [function.include]: Failed opening 'includes/languages/danish/modules/header_tags/ht_theme_switcher.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\catalog\includes\classes\osc_template.php on line 86

 

How can I fix this?

Thanks

xega

Edited by xega
Link to comment
Share on other sites

Does includes/languages/danish/modules/header_tags/ht_theme_switcher.php exist? I don't supply files in Danish, so you have to copy the file from the english/ directory and translate it.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Module Directory: C:/wamp/www/loss/catalog/includes/modules/header_tags/ I am having the following issue with Theme-Switcher. I have reinstalled Theme-Switcher and the jquery files several times, with same result. I will appreciate any suggestions. Other than receiving the error messages, everything appears to be working.

( ! ) Warning: Illegal string offset 'id' in C:\wamp\www\loss\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 159 Call Stack # Time Memory Function Location 1 0.0016 225672 {main}( ) ..\modules.php:0 2 0.1020 1311616 tep_call_function( ) ..\modules.php:264 3 0.1020 1311712 call_user_func ( ) ..\general.php:1281 4 0.1020 1311728 tep_jquery_check( ) ..\general.php:1281 5 0.1022 1311824 tep_get_directory_list( ) ..\ht_theme_switcher.php:292 6 0.1030 1313080 array_msort( ) ..\ht_theme_switcher.php:225

 

( ! ) Warning: Illegal string offset 'id' in C:\wamp\www\loss\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 186 Call Stack # Time Memory Function Location 1 0.0016 225672 {main}( ) ..\modules.php:0 2 0.1020 1311616 tep_call_function( ) ..\modules.php:264 3 0.1020 1311712 call_user_func ( ) ..\general.php:1281 4 0.1020 1311728 tep_jquery_check( ) ..\general.php:1281 5 0.1022 1311824 tep_get_directory_list( ) ..\ht_theme_switcher.php:292 6 0.1030 1313080 array_msort( ) ..\ht_theme_switcher.php:225

 

 

Theme Switcher Edit Remove Module

Switch your store theme from the admin.

Version: 1.4.2

 

 

Enable Theme Switcher

True

 

Sort Order

1

 

Jquery Version

1.8.3

 

Jquery UI Version

1.9.2

 

Theme

le-frog

 

 

tick.gifThe jQuery file was found.

 

 

tick.gifThe jQuery UI file was found.

 

 

tick.gifThe selected theme was found.

 

 

tick.gifThe selected version of the theme was found.

 

 

tick.giftemplate_top.php has been modified.

 

 

tick.gifThe language file was found.

Link to comment
Share on other sites

There is no 'id' on line 186 of that file. I can't read the rest of the error message since you've removed all of the formatting, but I suspect it's an invalid error. I don't get this on my test site, or on any of the live sites I've used Theme Switcher on.

 

Regards

Jim

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

Link to comment
Share on other sites

Module Directory: C:/wamp/www/loss/catalog/includes/modules/header_tags/ I am having the following issue with Theme-Switcher. I have reinstalled Theme-Switcher and the jquery files several times, with same result. I will appreciate any suggestions. Other than receiving the error messages, everything appears to be working.

( ! ) Warning: Illegal string offset 'id' in C:\wamp\www\loss\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 159 Call Stack # Time Memory Function Location 1 0.0016 225672 {main}( ) ..\modules.php:0 2 0.1020 1311616 tep_call_function( ) ..\modules.php:264 3 0.1020 1311712 call_user_func ( ) ..\general.php:1281 4 0.1020 1311728 tep_jquery_check( ) ..\general.php:1281 5 0.1022 1311824 tep_get_directory_list( ) ..\ht_theme_switcher.php:292 6 0.1030 1313080 array_msort( ) ..\ht_theme_switcher.php:225

 

( ! ) Warning: Illegal string offset 'id' in C:\wamp\www\loss\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 186 Call Stack # Time Memory Function Location 1 0.0016 225672 {main}( ) ..\modules.php:0 2 0.1020 1311616 tep_call_function( ) ..\modules.php:264 3 0.1020 1311712 call_user_func ( ) ..\general.php:1281 4 0.1020 1311728 tep_jquery_check( ) ..\general.php:1281 5 0.1022 1311824 tep_get_directory_list( ) ..\ht_theme_switcher.php:292 6 0.1030 1313080 array_msort( ) ..\ht_theme_switcher.php:225

 

 

Theme Switcher Edit Remove Module

Switch your store theme from the admin.

Version: 1.4.2

 

 

Enable Theme Switcher

True

 

Sort Order

1

 

Jquery Version

1.8.3

 

Jquery UI Version

1.9.2

 

Theme

le-frog

 

 

tick.gifThe jQuery file was found.

 

 

tick.gifThe jQuery UI file was found.

 

 

tick.gifThe selected theme was found.

 

 

tick.gifThe selected version of the theme was found.

 

 

tick.giftemplate_top.php has been modified.

 

 

tick.gifThe language file was found.

 

 

I found the problem. Reverted back to an older release of PHP

 

 

Link to comment
Share on other sites

There is no 'id' on line 186 of that file. I can't read the rest of the error message since you've removed all of the formatting, but I suspect it's an invalid error. I don't get this on my test site, or on any of the live sites I've used Theme Switcher on.

 

Regards

Jim

 

Thanks. I had to revert toan older version of PHP. That seems to have fixed it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...