"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.
Re: "Whats New" Scrolling Sidebox
Code:
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?
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.
Quote:
//$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:
Quote:
$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.
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.
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"
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.
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
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
Re: "Whats New" Scrolling Sidebox
Keep us updated how to get this thing to work well with 1.3 and be xtml compliant
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!