Jump to content
kymation

[Addon} Theme Switcher

Recommended Posts

Jim, thanks again your hospitality knows no bounds.

 

I have got one more question but that will keep for another day, possibly tomorrow I don't know, over here in Liverpool it is ten to three in the morning and there isn't enough coffee in the world to keep me up much longer.

 

Thank you again Jim, your a scholar and a gentlemen.

 

Bazil.


I hate everything about web programming, give me C++ and MFC any day. Strangely enough, I love OSc.

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

 

Thank you Jim.

 

Don't bang your head against a wall on my part, I can live with it.

 

Regards,

This Jim :)


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

Hi Jim,

 

I'm not sure if that image is being displayed or not, but if it is can you see when index.php displays a list of products every other product is not being affected by theme, any ideas?


I hate everything about web programming, give me C++ and MFC any day. Strangely enough, I love OSc.

Share this post


Link to post
Share on other sites

http://www.appypublications.com/screenshot.JPG

 

I'm sorry, I cannot upload any files and I can't edit my last post, it keeps saying No file was selected for upload, I've just placed an image on the server. Basically when a list of products is displayed every other product is ignoring the theme.

 

Do you have any idea what could be the cause please Jim?

Edited by BazilH

I hate everything about web programming, give me C++ and MFC any day. Strangely enough, I love OSc.

Share this post


Link to post
Share on other sites

This has nothing to do with the theme. There's a style in the stylesheet.css in the root of your store that controls the background in the alternate rows. To find it, use Inspect Element in Firefox or Chrome (or Firebug in Firefox). It will tell you the location where the background is being set.

 

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

Jim,

 

Thank you for your work on this contribution. Once I get it working, I'm betting it will be awesome.

 

I am using a %99.9 virgin install of OSC 2.3.3. I am using XAMPP version 1.8.1 for testing with PHP version 5.4.7. I have version 1.4.2 of Theme Switcher. I am using the versions of jQuery and jQuery UI that came with 2.3.3.

 

Two small problems:

 

1) I am getting the same errors as jhande.

@@jhande Find this line in includes/modules/header_tags/ht_theme_switcher.php:

 

 $colarr[$col]['_' . $k] = strtolower($row[$col]);

 

and change it to this:

 

 $colarr[$col]['_' . $k] = @strtolower($row[$col]);

 

Then this line:

 

 $ret[$k][$col] = $array[$k][$col];

 

and change to this:

 

 $ret[$k][$col] = @$array[$k][$col];

 

I might have to get more creative, but that is the quickest fix. It's not a real error in that it won't cause incorrect output; it's basically a technicality.

 

Regards

Jim

I have made these changes and eliminated the first error.

It's not really a serious error, which is why everything still works. However, I don't like error messages, so let's try to get a bit more creative here. Change that last line to:

 

$ret[$k][$col] = @ isset($array[$k][$col]) ? $array[$k][$col] : '';

 

That should make it shut up.

 

Regards

Jim

And, same as jhande, I still have the second error.

 

2) I'm a little older then I used to be, but I'm still up to the task of reading three numbers on one screen and typing them into another screen :) I *KNOW* I have typed in the versions that I have yet Theme Switcher insists I have it wrong:

http://img62.imageshack.us/img62/4233/storej.jpg

 

Any help on these issues would be greatly appreciated. Thank you.

Edited by Snarg

Share this post


Link to post
Share on other sites

1. I still don't have a final fix for this. I haven't had time to look at it further. As I said before, it's not a fatal error, just a warning.

 

2. Sorry, but the code is probably right. It may not be the number that is the problem. Check that your jQuery filename is jquery-1.8.0.min.js and not jquery-1.8.0.js or jquery-1.8.0.custom.js or some other variant. Same for the other two files.

 

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

Thanks Jim, I just set the background colour as a transparent and it looks sweet now.


I hate everything about web programming, give me C++ and MFC any day. Strangely enough, I love OSc.

Share this post


Link to post
Share on other sites

Thanks Jim for this Addon !

 

As far as I can see everything works fine but I got a lot of warnings on the Admin side:

 

Warning: Illegal string offset 'id' in C:\Program Files\EasyPHP-12.1\www\Nueva carpeta\oscommerce-2.3.3\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 159

 

Warning: Illegal string offset 'id' in C:\Program Files\EasyPHP-12.1\www\Nueva carpeta\oscommerce-2.3.3\catalog\includes\modules\header_tags\ht_theme_switcher.php on line 186

 

What should I do?

 

Thanks and regards, Andres

Share this post


Link to post
Share on other sites

@@andresull Read a few posts up -- there's a solution for one of those, and I'm still working on the other.

 

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 have it working now Jim. Thank you for this mod and for the tech support.

 

I upgraded the stock 2.3.3 jQuery from 1.8.0 to 1.8.3. I left the stock 2.3.3 ui module version at 1.8.22. I have not tried to switch a theme yet but I don't predict any problems. I still have the line 186 error but I can live with that.

 

I have two short questions now:

 

1) I have your Categories Accordion Box mod installed. Will any changes I make with Theme Switcher be reflected on my new categories box?

 

2) Since newer versions of jQuery seem to be buggy with osCommerce, am I still able to use Theme Roller to make new themes?

 

Thank you in advance.

Share this post


Link to post
Share on other sites

I am unable to edit my post above. Odd. Anyway, here is my revised post:

 

I have it working now Jim. Thank you for this mod and for the tech support.

 

I upgraded the stock 2.3.3 jQuery from 1.8.0 to 1.8.3. I left the stock 2.3.3 ui module version at 1.8.22. I have not tried to switch a theme yet but I don't predict any problems. Tried the le-frog theme, works great. Thanks! I still have the line 186 error but I can live with that.

 

I have two short questions now:

 

1) I have your Categories Accordion Box mod installed. Will any changes I make with Theme Switcher be reflected on my new categories box? Yep, the categories box updates with the theme. Thanks again!

 

2) Since newer versions of jQuery seem to be buggy with osCommerce, am I still able to use Theme Roller to make new themes?

 

Thank you in advance.

Share this post


Link to post
Share on other sites

Yes, but you may experience problems with compatibility. The ones I have tried work fine, but adding additional jQuery widgets (such as the Accordion) will increase the risk of incompatibility. The only way to find out is to try it.

 

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

 

I have a hugh problem, no graphic on the site when I have installed this script.

I have read the troubleshooting and all the files should be ok (incl. versions numbers)

I'm running ver 2.3.3 an its a new install.

 

Do you have any suggestions what hav went wrong ?

Share this post


Link to post
Share on other sites

Use the version of /includes/template_top.php that came with this Addon. Does that make any difference?

 

Using Firefox, open View Source on one of your pages. Click on each of the links in the head section in turn. Do any of those links result in a 404 Not Found message?

 

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 Everyone.

I installed the Theme Switcher Addon on oScommerce ver 2.3.3 and it is working well. I have changed the theme and tested it. Everything seems in order except for the item pics. The issue that I am facing, is that initially (before installing Theme switcher), if you click on the item pic to see a larger picture, it used to open up the pic in a pop up window with the option of scrolling between pics (if there are multiple pics for the item), but now, after adding the Theme Switcher Addon, if you click on the item pic it opens up in a new tap on the same browser window!! :(

Can someone please help and advise on how to rectify this issue.

Many thanks

Share this post


Link to post
Share on other sites

osCommerce uses Fancybox to control the image popup. Maybe the supplied version of Fancybox is not compatible with your updated jQuery files. Try replacing it with the current version.

 

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 Folks,

I am looking to install this add-on but I am concerned about template_top.php as I have edited this file in the past to accomodate other add-ons, hence

if someone can guide me what to edit/add to my existing code that would be much appreciated. I know I can run a comparison but that will still not exactly help me here...My current code looks like this:

 

?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 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="X-UA-Compatible" content="IE=EmulateIE8">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<?php include(DIR_WS_INCLUDES . 'easy_meta_tags.php'); ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
<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
 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>
<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'); ?>
</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() : ''); ?>">

 

Thnk you for your help, Gary

Share this post


Link to post
Share on other sites

A comparison program (Meld, Winmerge, etc.) will help you spot the changes. You need to remove three lines and move one more. It's not that hard.

 

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,

Which 3 lines as I just ran the comparison using Winmerge and it come up with about 15 lines of code difference?

Share this post


Link to post
Share on other sites

These three:

 

<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>

 

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,

 

Sorry for all the crazy questions but I have changed template_top and copied it my server

I have copied across the 2 new files.

 

Now I go into admin and I dont see any Header Tags module in module to configure?

I am following your install instructions and dont read anything else that I was suppose to have done.

 

I am using osc 2.2? Could that be the problem?

 

Regards, Gary

Share this post


Link to post
Share on other sites

As the instructions say, this module will not work with any version of osCommerce older than 2.3.0 without extensive modifications. Since you already have a template_top.php, you have apparently made some of those modifications already. If you don't have the Header Tags category under modules in your admin, you haven't made enough of the required changes. There's no guide for doing the remaining changes other than comparing your files to a stock copy of osC 2.3.x.

 

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

Thanks Jim - I have submitted a Commercial forum request as I have no idea what else to change

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

×