Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Scrolling What's New Box


mirza_yasir4

Recommended Posts

Dear Everybody

Scrolling What's New InfoBox by Yasir Imran Mirza

 

This contribution scroll your latest added products in InfoBox.

 

Installation:

 

Overwrite the file whats_new.php into your catalog/includes/boxes/ directory.

That's it!

Feel free to contact me with any suggested enhancements or bugs.

 

See it in action here:

http://www.nasa4ppc.com

 

Note:

This code could be used to any info box in OsCommerce site, If you feel dificulty in using this for any other box, please contact me.

 

Available for Download here

http://addons.oscommerce.com/info/6199

 

Best Regards

Yasir Imran Mirza

yasirimran.wordpress.com

 

Just modified the source of (Scrolling specials v1.0 by Justin Rains)

Edited by Jan Zonjee

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Nice contribution was just wondering if you could help me with a couple of things.

 

The 1st one is can you have the scrolling box for each language as currently it shows the same image for all three languages. Also can you limit the amount of clips it shows? E.g the last 5 new clips or something.

 

Thanks,

 

Craig

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 5 weeks later...

Just what I was looking for. I had the scrolling specials in and that really has pushed sales, especially after I managed to make it choose a random selection of items from the db. I started trying to modify the code so I could have the same for the new items but was beyond me so had a quick look and here it is . .great although on my store I could not get it to centre the items so added a old school <div align= so if anyone can help with that one I would much rather get rid of the div if poss. I did try copying some of the code from the specials which centres no problem but without any luck.

 

Anyway, thanks for the help , great contrib.

 

see it . . www.binkycrafts.com/shop/

Binyks.

Edited by Jan Zonjee

Tony

Link to comment
Share on other sites

  • 1 month later...

example: http://islandtat.net/index.php

 

the scrolling is very JERKY - please HELP !!!

 

 

 

 

Dear Everybody

Scrolling What's New InfoBox by Yasir Imran Mirza

 

This contribution scroll your latest added products in InfoBox.

 

Installation:

 

Overwrite the file whats_new.php into your catalog/includes/boxes/ directory.

That's it!

Feel free to contact me with any suggested enhancements or bugs.

 

See it in action here:

http://www.nasa4ppc.com

 

Note:

This code could be used to any info box in OsCommerce site, If you feel dificulty in using this for any other box, please contact me.

 

Available for Download here

http://addons.oscommerce.com/info/6199

 

Best Regards

Yasir Imran Mirza

yasirimran.wordpress.com

 

Just modified the source of (Scrolling specials v1.0 by Justin Rains)

Link to comment
Share on other sites

  • 1 month later...
can you post one that scrolls horizontally please ?? many thanks

 

Sorry for too late response, I don't know if you managed to complete it or not

however to scroll it horizontally, you need a minor code changing

around line no.36 in whats_new.php

 

	$info_box_contents[] = array('text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$bestsellers_list.'</MARQUEE>');

 

change the direction="up" to direction="right" or direction="left"

like this

 

	$info_box_contents[] = array('text' => '<MARQUEE behavior= "scroll" align= "center" direction= "right" height="160" scrollamount= "2" scrolldelay= "70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$bestsellers_list.'</MARQUEE>');

Edited by mirza_yasir4

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

example: http://islandtat.net/index.php

 

the scrolling is very JERKY - please HELP !!!

 

sorry for late response, this is simple html <marquee> tag

you can google it and you will find a lot of options to control this movement, speed, direction, delay etc.

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

  • 4 months later...

This does not work for me. I'm using v. RC2.2a and just keep getting errors. I only want 3 images on the What's New box, no scrolling, but I can't seem to write it out in php.

☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

Link to comment
Share on other sites

  • 2 weeks later...

Hi mirza_yasir4,

 

I installed it without any problems but the display is not centered. I also installed at the same time the addon for Scrolling Specials found here which is centered. Your's seems to be aligned left. How can I center the scrolling in the middle of the what's new box?

 

Thanks.

Link to comment
Share on other sites

This does not work for me. I'm using v. RC2.2a and just keep getting errors. I only want 3 images on the What's New box, no scrolling, but I can't seem to write it out in php.

 

 

Which browser you are testing ?

 

it is working for me 100 % on 3 major browsers, IE, firefox and Chrome.

check this

www.nasa4ppc.com

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

Hi mirza_yasir4,

 

I installed it without any problems but the display is not centered. I also installed at the same time the addon for Scrolling Specials found here which is centered. Your's seems to be aligned left. How can I center the scrolling in the middle of the what's new box?

 

Thanks.

 

 

Go into code and find where alignment is left, just replace it with center

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

Go into code and find where alignment is left, just replace it with center

 

Thanks Yasir,

 

Tried that but that didn't solve the problem. I also tried adding adding the following at line 36 which didn't work either:-

 

 $info_box_contents[] = array ('align' => 'center',
										 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$bestsellers_list.'</MARQUEE>');

 

That marquee code does state align center but for some reason it's align left and not in the center of the box.

 

Thanks.

Link to comment
Share on other sites

Thanks Yasir,

 

Tried that but that didn't solve the problem. I also tried adding adding the following at line 36 which didn't work either:-

 

 $info_box_contents[] = array ('align' => 'center',
										 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$bestsellers_list.'</MARQUEE>');

 

That marquee code does state align center but for some reason it's align left and not in the center of the box.

 

Thanks.

 

 

What is your shop's address ? url ?

 

Try this

Line 28 to 21

	$bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
while ($whats_new = tep_db_fetch_array($whats_new_query)) {
  $rows++;
  $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">'  . '</td><td class="infoBoxContents">'. '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' .tep_image(DIR_WS_IMAGES . $whats_new['products_image'], $whats_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT).'<br>'. tep_row_number_format($rows). '. <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' . $whats_new['products_name'] . '</a></td></tr>';

 

replace the above with this

	$bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1" align="center">';
while ($whats_new = tep_db_fetch_array($whats_new_query)) {
  $rows++;
  $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top" align="center">'  . '</td><td class="infoBoxContents" align="center">'. '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' .tep_image(DIR_WS_IMAGES . $whats_new['products_image'], $whats_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT).'<br>'. tep_row_number_format($rows). '. <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' . $whats_new['products_name'] . '</a></td></tr>';

Edited by mirza_yasir4

Thanks and Regards

Yasir Imran Mirza

My Contributions

Link to comment
Share on other sites

  • 1 year later...

Very nice contribution but I am having some problems. When I added this contribution to my site, all of my products got shifted and are now appearing underneath the "what's new" area. My products used to appear up by my header but are now all the way down at the bottom on the page. PLEASE HELP!!

 

This is what my code looks like:

 

<?php
/*
 $Id: whats_new.php,v 1.21 2003/06/09 22:07:52 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $whats_new_query = tep_db_query("select distinct products.products_id,products_description.products_name, products.products_image, products.products_tax_class_id, products.products_price from " . TABLE_PRODUCTS . ",products_description where products.products_status = '1' AND language_id = $languages_id AND products_description.products_id = products.products_id order by products_date_added desc limit 10");


 if (tep_db_num_rows($whats_new_query) >= 5) {
?>
<!-- whats_new_scroll //-->
         <tr>
           <td>
<?php


 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

 new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));


   $rows = 0;
   $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
   while ($whats_new = tep_db_fetch_array($whats_new_query)) {
     $rows++;
     $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">';  
     $bestsellers_list .= '</td><td class="infoBoxContents" align="left">';
     $bestsellers_list .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' . $whats_new['products_name'] . '</a><br>';
     $bestsellers_list .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">';
     $bestsellers_list .= tep_image(DIR_WS_IMAGES . $whats_new['products_image'], $whats_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
     $bestsellers_list .= '<br><br>';
     $bestsellers_list .= '</td></tr>';
   }
   $bestsellers_list .= '</table>';

   $info_box_contents = array();
   $info_box_contents[] = array('text' => '<MARQUEE behavior= "scroll" align= "left" direction= "left" height="160" scrollamount= "2" scrolldelay= "70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$bestsellers_list.'</MARQUEE>');


   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- whats_new_scroll_eof //-->
<?php
 }
?>

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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