Zen Cart Logo
Forums / Addon Sideboxes / "Whats New" Scrolling Sidebox

"Whats New" Scrolling Sidebox

Locked

Views: 33,142

Results 1 to 20 of 93
This thread is locked. New replies are disabled.
18 May 2006, 12:39 PM
#1
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

"Whats New" Scrolling Sidebox

The old What's New sidebox that automatically changes the product every 5 seconds without refreshing the page has a slight bug... or "under-feature" might be a better term.

There are multiple product types that come with Zen-cart: Product General, Document, Music, etc. The what's new scrollbox auto assumes your product will be product-general, so if someone clicks that item for more information from the scroller sidebox, it will load that item using the 'Product - General' template, and not the template that the item was actually designed under, so it won't show all the proper fields and data you want.

I've taken a quick look at the code, but couldn't see initially how to fix it. Can anyone else point me in the right direction. I've also tried contacting the creator, but there has been no response yet.

18 May 2006, 12:48 PM
#2
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">

The problem is in this link, It's using FILENAME_PRODUCT_INFO as the page name, which needs to be changed to adapt to the product type. Any takers?

18 May 2006, 1:15 PM
#3
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

Well I took a look at the default zencart what's new sidebox and see the difference. It's using a zen_get_info_page function. Funny thing is, it doesn't seem to change the behavior.

//$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . **zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
replaced with:
$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . **zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">
<img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';

But it still shows the link as "main_page=product_info" instead of "main_page=product_music_info", and I'm sure the product type is correct.

18 May 2006, 1:42 PM
#4
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

I think the problem may be something im not updating on my custom product type. I will look into it more.

18 May 2006, 2:10 PM
#5
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

My search led me to believe there was a problem in my /includes/modules/pages/product_tabbed_info/main_page_template_vars.php file, but it all appears correctly and points to my template file I made for the tabbed products, yet still, the link is formed with "product_info" instead of "product_tabbed_info"

18 May 2006, 7:57 PM
#6
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

Ok I'm stumped. it links properly from the New Products menu from the categories and when i click on my item, it loads the right page template. I tried the default whats new, and oddly enough, it never even shows that product.. even after refreshing 100 times.. also the New products on the main page doesn't seem to ever show that new product. But the Scrolling whats new shows it.. but with a broken link.

18 May 2006, 9:37 PM
#7
simon_m avatar

simon_m

New Zenner

Join Date:
Jan 2006
Posts:
71
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Hi all

can someone supply a .zip for this,
and can it be uesed for product as it would be good.

Thanks

simon

18 May 2006, 10:15 PM
#8
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

zip for what? tabbed product type or the scrolling whats new sidebox?

The whats' new sidebox is old and it's what I'm trying to fix, the tabbed product type is what Im working on and thats how i found this bug in the scrolling whats new box that hard coded the product_info page. Now that I've updated the file with the new zen method of finding the product page, it seems that the problem is actually a logistics thing. Because of the way the javascript only refreshes the product ID, the rest of the URL stays static. So i think it needs more than just a one line change, it needs to update the product type page as well as the product id

18 May 2006, 10:27 PM
#9
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Keep us updated how to get this thing to work well with 1.3 and be xtml compliant

18 May 2006, 10:43 PM
#10
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

NEW VERSION!!!

I fixed it. It was simpler than I thought, once again thanks to Zen-Magic :)
Updated What's New Scroller Attached!

18 May 2006, 11:03 PM
#11
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

I would say good job but it doesnt have the borders on the sidebox and not xtml compliant :(

19 May 2006, 3:23 AM
#12
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

? Borders are set by the main css of your store. And I didnt create the contrib, I only made it work properly with multiple product_types...it was a one line change. The alterior motive of this change is for MY upcoming contrib that allows users to have tabbed product descriptions.. But i needed this contrib fixed for it to work right with my contrib..

As far as being xhtml compliant.. thats a pipe dream that will never see full compliance until well after we are dead... it wont affect much anyway, as today's browsers are full of bandaids to handle it.

19 May 2006, 5:18 AM
#13
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

I hear you, q Congratz :) , I guess you know better about xtml.. not really sure whats it for, as far as borders the regular whats new sidebox has borders but when I load in the scrolling whats new its missing the sidebox side borders, nay idea how to fix this?

20 May 2006, 12:54 AM
#14
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

rxalex:

I hear you, q Congratz :) , I guess you know better about xtml.. not really sure whats it for, as far as borders the regular whats new sidebox has borders but when I load in the scrolling whats new its missing the sidebox side borders, nay idea how to fix this?

Hmm no.. do you have any modifications to your css? I have the scrolling sidebox here: https://www.tvclassico.com and it seems to work fine, borders and all.

8 Jun 2006, 5:08 PM
#15
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Ghome,
Wow great work, But my image size is only 100 by 1 px???
Adim is set to 100 x 80 for new products....
What is the problem??????

Mark

8 Jun 2006, 6:14 PM
#16
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

I didn't create the contrib.. i only updated it for 1.3 to use product types properly. I'm not sure why your images are showing up that small tho. Go back to the default and see if that has the same problem.

Also if you have a site I can look at I could maybe figure out the problem .

8 Jun 2006, 6:38 PM
#17
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Qhome,
https://www.gomagnetic.com

I have checked my admin/configeration/images setting for new products: 100 x 80.
In new products links in Categories on web site the image is perfect.
But, the Whats New Sidebox on right side show image depressed to 100 x 1.

Any help please...

mark

8 Jun 2006, 7:43 PM
#18
ryska avatar

ryska

New Zenner

Join Date:
Apr 2005
Location:
Louny, Czech Republic
Posts:
50
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Works fine but this box have about 600 queries from DB to one refresh of page. It´s very much.

9 Jun 2006, 12:33 AM
#19
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: "Whats New" Scrolling Sidebox

Finally got the old girl to work properly.

Original Code:
// ADDED BY QHOME TO UPDATE FOR 1.3.0.1 (zen_get_info_page)
//$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . zen_href_link(zen_get_info_page($random_product->fields['products_id']), 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
//##########################################

All I did above was add the height of 80px. Yes, victory.

Example Below:
// ADDED BY QHOME TO UPDATE FOR 1.3.0.1 (zen_get_info_page)
//$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height=80px"' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
$newsflashes[$i] = '<br /><center><a class="wnImage" href="' . zen_href_link(zen_get_info_page($random_product->fields['products_id']), 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height=80px"' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onMouseOver="myHint.show('TT4')" onMouseOut="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
//##########################################

Mark,

9 Jun 2006, 1:54 AM
#20
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: "Whats New" Scrolling Sidebox

nah,, only about 200 queries.. but really the SMALL_IMAGE_HEIGHT wasn't changed from the original. And that works fine on my fresh install of Zen.. im not sure why its not pulling from your database properly. If it were to ever start working it would break your code. You should remove the SMALL_IMAGE_HEIGHT and leave only the 80px