Jump to content
Sign in to follow this  
mirza_yasir4

Scrolling What's New Box

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I like, thank you :D


Heather...

 

icon_baby_crawl-1.gifCrawling my way through pages of code with my fingers crossed and one eye on here. Grateful to many at the osCommerce Community. Thank YOU

 

Coding successes: GV & Coupons, UltraPics, FCK Editor, Product Listings Enhancement, Short Descriptions, Define Main Page, Text Box, Attribute Sets Plus, . PayPal WPP. UL Catagories. Dynamenu. Featured Products. Mailist Report 1.2. Easy Meta Tags (Now even I could have screwed that up) Sold Out but Displayed 0.3. Club osc Specials on Front Page. Order Editor. HTML Emails V2

Working on: SEO

 

 

Proud member of the Code Breakers Club

Share this post


Link to post
Share on other sites

Hi

 

Nice contribution, thanks.

 

I think a nice add-on would be to give the customer the option to stop and start scrolling.

:)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Share this post


Link to post
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.


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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
How can I use this for my best sellers box?

 

Thank you

 

 

You need to get involved in code, however I can't help you, I am busy


Thanks and Regards

Yasir Imran Mirza

My Contributions

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Is there a scrolling what's new for OsC 2.3.3.4? I tried the newest 1 and it didn't work, I got some error msg.

 

Millie

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
Sign in to follow this  

×