Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Banner Box for 2.3


kymation

Recommended Posts

Yes. Find this code in the module file:

 

 global $language, $oscTemplate;

if ($banner = tep_banner_exists('dynamic', 'hfc_module')) {

 

and change it to this:

 

 global $language, $oscTemplate, $current_category_id, $PHP_SELF;

if ($banner = tep_banner_exists('dynamic', 'hfc_module') && $PHP_SELF == 'index.php' && $current_category_id == 0 ) {

 

Regards

Jim

 

Hi, I found the error. I changed the code to this, and its not showing the error msg i stated. But when i use the original code, it works fine..

Link to comment
Share on other sites

Hi Jim, 

 

I have a problem installing the module. 

I have read your manual and followed the step like the manual said. 

 

When I try to install the module in my admin panel, the module is not visible. 

Does this problem occurred before or do you have a solution? 

 

Dear regards, 

 

Ben 

Link to comment
Share on other sites

@@shafa1827  You've made a mistake in the placement of that new code. Check again that you have it in the correct location. If it still doesn't work, post the error meccage that youare getting and the cod that you have chaged, including a few lines before and after so I can see where it is.

 

@@benwijns  The most likely cause is that you ave uploaded one or more files to the wrong location. Check the file locations in the instructions against yours.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 5 months later...

Thank you for this contribution.  It works great until I set Rotate Banners to "True".  For some reason the banners don't show up nor the navigation controls.  The only thing that displays is a small 5 pixel dark square where the banners should be.  Seems to be independent of browsers. 

Link to comment
Share on other sites

Check that you have the Banners Box Goup Name in the module set to the same group as your banners in your Banner Manager.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

The names are matching.  I even changed them to a new name for the group just to double check and still no luck. 

 

I uninstalled and reinstalled the module and still no luck. 

 

It almost feels like a javascript problem I'm having because everything works fine until I change Banner Rotate to "True". 

 

Also When I check my bm_banner_rotator.php file the variable var $enabled = True is not being changed from "false" to "true" when I change the value in the admin panel.  I changed it to "True" manually, but that didn't change anything.  

Link to comment
Share on other sites

Check that the files in your /ext/jquery/bannerRotator/ directory are there and not corrupted. That's the JavaScript that manages the rotator.

 

The values in the file will never change; those are just the default values. The actual values are stored in the database. If you changed it manually, check that you changed it to True and not true. It's a text variable and we don't check for case.

 

Regards

Jim

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

Link to comment
Share on other sites

I've been looking it over for a few hours.  Everything looks good.   I tried playing around with where the javascript ready function was being called in bm_banner_rotator and got the first banner to load, but still could not get banner rotation.  Probably dumb luck.  Would it be possible for me to see the html source for a webpage using the rotator function? 

 

Also, if one of my banners was bad (eg. bad id number, bad code) would that stop the other banners from displaying in the rotation? 

Link to comment
Share on other sites

I don't have this set up on a test site. I'll try to do that later if I have the time.

 

I've never tried a banner rotator with a bad banner file. Check that all of your banners will display by calling them individually in the module or directly in your browser. A bad banner ID should only affect the bad banner and not the others.

 

Regards

Jim

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

Link to comment
Share on other sites

well, I checked my source code and all of my banners display properly on a blank html page ie. the banner array loaded by the bm_banner_rotator.php module is good.  The only thing left now that I can think of are the arguments that are being passed to the javascript function.  I think that for some reason empty arguments are being passed to the javascript function.  This would explain why the banner controls display, but no images display when I set rotation to true. 

 

Actually could the problem be that I am using jquery for another function on my page?  The banner rotation function depends on jquery right?  Is it ok or possible to use jquery for multiple functions at the same time?  

Link to comment
Share on other sites

It's OK to use jQuery on multiple functions on a page. Stock osCommerce uses jQuery to generate the page theme, buttons, etc.

 

Possibly the version of jQuery you are using is incompatible. I haven't seen this problem before, so I can only suggest some of the things I've seen before that cause problems with the banner rotator in various ways.

 

Try using Firebug in Firefox to inspect the banner box. That will tell you if the banner calls are malformed or missing the images.

 

Regards

Jim

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

Link to comment
Share on other sites

Thank you so much.  Firebug was exactly what I needed.  It took me about 10 hours, but it gave me a much better understanding of what was going on.  Awesome tool.  Combined with stackoverflow.com and jsfiddle I was able to nail the problem down to javascript...jquery to be exact.  I had a template installed that was using an outdated jquery, maybe even a custom one.  Not only that, but your banner and one of my previously installed sliders were colliding due to how and when the functions were being called.  I didn't figure any of this out until I was halfway into replacing the Beacon 9 jquery banner rotator with the Unslider jquery slider inside of your BannerRotator install. 

 

Long story short, I tweaked a few settings for the new jquery script, updated my jquery files, moved the javascript ready function from the default location in your bannerRotator.php file (I was having problems with a line in bm_banner_Rotator.php where the argument passed to the javascript function is a class) into the header as pure javascript and now everything is working ok. 

 

Thanks again for your quick responses.  I appreciate all of your help.  I learned a lot.    

Link to comment
Share on other sites

Glad to hear you got it working. Software conflicts are always a pain; JavaScript double so.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 7 months later...

Hi, I installed the latest version of Banner Box, but when I want to install the module in the admin panel, this error appears:

Fatal error: Cannot redeclare class bm_banner_rotator in C:\xampp\htdocs\oscommerce234\catalog\includes\modules\boxes\bm_banner_rotator.php on line 15

 

What is it that I have to do to make it work? Thank you very much.

Link to comment
Share on other sites

There are two possibilities:

1. you put one of the files in the wrong place. Try uploading the files again.

2. You have another banner rotator somewhere else on the page. They conflict, and the second one throws an error.

 

Regrds

Jim

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

Link to comment
Share on other sites

  • 1 month later...

There are two possibilities:

1. you put one of the files in the wrong place. Try uploading the files again.

2. You have another banner rotator somewhere else on the page. They conflict, and the second one throws an error.

 

Regrds

Jim

 Dear Jim, I apologize but I am a very beginner. I changed the class name in catalog/includes/modules\boxes\bm_banner_rotator.php from class bm_banner_rotator to class bm_banner_rotator1. In the Admin it works fine. I installed the module and uploaded 2 banners. But on the side they do not appear. I guess I have to change something else. Maybe you could give me a clue? Thank you very much.

Link to comment
Share on other sites

  • 3 months later...

Working on OSc 2.3.4, I installed your addon. Everything is working so far.

 

Question:

 

I don't want to rotate any banners. How do I have to change the code if I just want to have the english banner on the english version of the shop, the german on the german, and so on. Right now they are picked randomly - therefore I don't know for what the languages which I set in the banner-manager are good for?

 

Thank's for any reply.

stefan

Link to comment
Share on other sites

osCommerce 2.3.4 doesn't have any language controls in the Banner Manager. It's single language only. If that's something you've added, of course it is not compatible with the stock Banner Rotator. You'll need to make changes to the code to do that.

 

Regards

Jim

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

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