![]() |
NightFire 50% Answer
Quote:
As for the title, that's an easy one... Go to random_image.tpl and add the following line above (or within) the a href= tag... Code:
... Just guessing, but I assumed the rand was returning outside the bounds of $config.Modules.number_of_randomproducts Sure enough, this occurred as I had expected. $config.Modules.number_of_randomproducts was set to 3, and occassionaly $rand resulted as 3, but arrays are an option base 0, so 3 is outside of the boundaries. To modify my above temporary fix, I account for this, and subtract 1 if necessary, resulting in the following: Code:
{assign var="rand" value="0"|mt_rand:$config.Modules.number_of_randomproducts} |
You are correct about the array and sometimes it will generate a random number outside the array limits. I corrected my post. All that was necessary was to change the assign to :
Code:
{assign var="rand" value="0"|mt_rand:"`$config.Modules.number_of_randomproducts-1`"} Good catch. |
It's working great. Thanks for the fixes.
Another question. The random image is displaying the thumbnail size which is set under the general settings. But is it also possible to change this image size in the random_image.tpl so that it has a custom size? The products wich are displayed in the categories will still have their original size then. Edit: Found a bug in the random image script. I placed the random image script on the homepage. But when you click on the product you'll be redirected to the product page. But the place where the random image script, is displaying no image availlable and it isn't displaying a product title. And it redirects me to this when I click on it: www.shopurl.com/shop/image.php?productid= Hope someone find a solution for this. |
Quote:
NightFire, This is the same error that we were speaking about above (Prev 2 Posts) Please implement the fix to correct this. |
hi, I seem to be having problems with implementing this mod. please visit http://www.digi-quick.com/error_message.php?access_denied&id=33
home.tpl Code:
<?php random.php Code:
<?php random.tpl Code:
{capture name=dialog} random_image.tpl Code:
{assign var="rand" value="0"|mt_rand:"`$config.Modules.number_of_randomproducts-1`"} |
Look at the install instructions again....you have some php referenced in home.tpl when it should be in home.php.
|
thanks balinor, I've got it to work now.
only thing is that it's not really what I was looking for. I was trying to figure out a way adapt the 'Featured Products' tools so that it only shows random products from specified categories. Has such a mod been developed. Thanks for any help. |
That is exatly what this does?
|
What about disabled categories?
TelaFirma,
This is a sweet Mod, Tela! Wanted to point out that another thing that I also noticed is that the random image returned sometimes returns images from DISABLED categores. This is not ideal, at least for our shop. I'm sure I could correct this, but reviewing func_search_products within func.php didn't lead me to any 'smoking gun' right off the bat, anyhow... Don't know if you were aware of this... |
Quote:
Isn't it just a matter of placing this on one of your category pages? Code:
# |
All times are GMT -8. The time now is 07:08 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.