Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jQuery Banner Rotator


kymation

Recommended Posts

Hi Jim,

 

I have added the banner rotator to my shopping cart and I have displayed it after the logo. I have added the code in the header.php. The banner is showing ok on the home page but not showing on any other pages eg contact us etc... I want to show this on all the pages, what should I do to show this on all the pages?

 

Thanks

Bharti

Link to comment
Share on other sites

To make the banner rotator work on other pages, you will need to add the Javascript code to the head of every page that you want it to work in. See catalog/index.php, lines 43-51 in the banner rotator distribution.

 

Regards

Jim

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

Link to comment
Share on other sites

That's right. You said before that you had this working. If uploading two banners made it stop working, then there is a problem with one or both of those images.

 

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 thank you for this contribution, was looking for something like this. ok here goes, i have managed to add the banner group and the banner shows up on my homepage and as i have only added one it changes within itself.

 

I have now added another banner within banner manager, with the same title, group but just a different image and now the second banner shows up underneath the first one and this has also stopped playing. i have removed this one but the first one doesnt play anymore?

 

can any1 help me understand where i have gone wrong? any help would be really appreciated.

 

thanks in advance.

Link to comment
Share on other sites

hi, first of all thank you for this contribution, was looking for something like this. ok here goes, i have managed to add the banner group and the banner shows up on my homepage and as i have only added one it changes within itself.

 

I have now added another banner within banner manager, with the same title, group but just a different image and now the second banner shows up underneath the first one and this has also stopped playing. i have removed this one but the first one doesnt play anymore?

 

can any1 help me understand where i have gone wrong? any help would be really appreciated.

 

thanks in advance.

 

apologies, i have sorted it. reuploaded the stylesheet and it started working again! btw how can i control the alignment of the banner as it appears on the right side of the page whereas my website through sts is aligned to the centre of the page, any ideas?

Link to comment
Share on other sites

The banner alignment is designed to work with stock osCommerce, not STS. You can probably fix this by playing with the CSS for the Banner Rotator. Try changing the top and left settings under #bannerRotator ul li. You may have to add a container and align that instead.

 

Regards

Jim

 

regards

Jim

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

Link to comment
Share on other sites

kymation, thanks for your response. i have added a container within the stylesheet, and applied this to the banner_rotator.php file using the following code but this doesnt change anything.

 

<!-- banner_rotator -->
 <div id="container">
 <div id="bannerRotator">
   <ul>
<?php 
   while( $banner = tep_db_fetch_array( $banner_query ) ) {
     echo '      <li>';
     if( $banner['banners_url'] != '' ) {

 

The following is what i have added within the stylesheet:

 

#container {
position: relative;
width: 718px;
margin: auto;

 

thanks for all your help, really appreciate.

Link to comment
Share on other sites

I don't know how to fix problems with templates. That was just a general suggestion to get you started. I suggest that you ask for help in the STS support thread.

 

Regards

Jim

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

Link to comment
Share on other sites

I don't know how to fix problems with templates. That was just a general suggestion to get you started. I suggest that you ask for help in the STS support thread.

 

Regards

Jim

 

kymation, i have managed to sort the issue as had a problem with my sts file. Btw another problem has popped up. The banner shows up on the Opera Browser in full, but when I check this on Internet Explorer only half the banner is shown. Any reason why this could be?

Link to comment
Share on other sites

I don't know. It works for me in Internet Explorer on a standard installation of osCommerce. I suspect that this is another conflict with STS.

 

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

Does this work with v2.3.1 please?

 

I'm wanting a rotator banner but not sure whether to go for this or the Modular front page contribution which has one in too. Trouble is I don't want all the modules so is this over kill?

 

I only have one column so can I adjust the size of the display so it is across the top of effectively grid_18 710px?

Is it determined by the image sizes or the css? What is the default with this?

 

Thanks

Link to comment
Share on other sites

This one is designed for 2.2RC2a, but could probably be made to work with 2.3.1 with a little modification. The one in the Modular Front Page addon is mostly the same code. I just built it into a module for ease of use with 2.3.1.

 

There's no need to shy away from Modular Front Page -- it's modular just so you can pick and choose the modules you want to use. If you only want the one, just install the one you want and leave the rest.

 

I'm currently using the modular version on a store design that only has the left column. You need to size the banner images accordingly, then make a couple of changes in the CSS to match your image sizes. I'm using images that are 790 pixels wide. The CSS properties that you need to change are marked in the files.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 3 weeks later...

I installed the contribution, but it doesnt work for some reason. My banners appear the same as before it was installed. I have banners on the header. I followed all the steps many times over, but still nothing happens when I load my store.

 

I also saw somewhere in earlier posts that you must have this code, include( DIR_WS_MODULES . FILENAME_BANNER_ROTATOR );

Where do I put this because I tried on configure.php and it gae an error that the file doesnt exist.

 

I am using a template RC2a.

Link to comment
Share on other sites

I am using a template RC2a.

This is most likely your problem. Templates make changes to the core code of osCommerce that prevent standard Addons from functioning. You may need to change your template to make this work.

 

This Addon does not make any changes to your existing banners. It adds a new banner box with banners that change.

 

The code that you quoted adds the banner rotator to the location where you paste that code. This has to be a location that can display a banner. It's normally added to index.php but can be placed elsewhere. See the instructions for more information.

 

Regards

Jim

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

Link to comment
Share on other sites

This is most likely your problem. Templates make changes to the core code of osCommerce that prevent standard Addons from functioning. You may need to change your template to make this work.

 

This Addon does not make any changes to your existing banners. It adds a new banner box with banners that change.

 

The code that you quoted adds the banner rotator to the location where you paste that code. This has to be a location that can display a banner. It's normally added to index.php but can be placed elsewhere. See the instructions for more information.

 

Regards

Jim

 

Thanks for your respond, thats probably the problem, eish would have loved to use the contribution. Will keep on trying it anyway.

Link to comment
Share on other sites

  • 2 weeks later...

Hi kymation,

 

Hope all is excellent with you and thanks for the snazzy mod

 

Re Post #11

Problem completely solved with:

 

jQuery.noConflict();

 

Having similar symptoms - seeing dots (well, one large black one)

 

Not sure how to implement the cure (jQuery.noConflict();)

 

This didn't work:

 

<?php // Start Banner Rotator 1.2.1 20100628 Kymation 7641 ?>

<script type="text/javascript" src="includes/functions/jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="includes/functions/bannerRotator.js"></script>

<script type="text/javascript">

 

jQuery.noConflict();

 

$(document).ready(function(){

bannerRotator('#bannerRotator', 500, 1000);

});

</script>

<?php // End Banner Rotator 1.2.1 20100628 Kymation 7641 ?>

 

Tried several variations, including: (in index.php)

var $j = jQuery.noConflict();

// Use jQuery via $j(...)

$j(document).ready(function(){

bannerRotator('#bannerRotator', 500, 1000);

});

 

along with renaming all the $( instances in bannerRotator.js to $j(

(yes, the desperation is running thick and heavy)

 

This caused the page to stop loading and no dot

(with both the original bannerRotator.js $( and the modified $j( version)

 

There are 3 banners in the rotator group and I put breakpoints in the function/banners.php

to make sure the queries are populated, (which the black dot might be confirming?)

 

Could you please elaborate on how to use: jQuery.noConflict();

 

Thanks for your insight (and mercy)

 

jk

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