| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Random Image or Random Products - Category Specific | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
![]() 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:
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU |
|||||||||
#12
|
|||||||||
|
|||||||||
![]() 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:
Good catch. |
|||||||||
#13
|
|||||||||
|
|||||||||
![]() 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.
__________________
Best regards, Niki Buitenrust Hettema X-Cart Gold 4.1.8 (Live & Loaded) Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more... |
|||||||||
#14
|
|||||||||
|
|||||||||
![]() Quote:
NightFire, This is the same error that we were speaking about above (Prev 2 Posts) Please implement the fix to correct this.
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU |
|||||||||
#15
|
|||||||
|
|||||||
![]() 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:
random.php Code:
random.tpl Code:
random_image.tpl Code:
|
|||||||
#16
|
|||||||
|
|||||||
![]() Look at the install instructions again....you have some php referenced in home.tpl when it should be in home.php.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#17
|
|||||||
|
|||||||
![]() 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. |
|||||||
#18
|
|||||||
|
|||||||
![]() That is exatly what this does?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#19
|
|||||||||
|
|||||||||
![]() 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...
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU |
|||||||||
#20
|
|||||||||
|
|||||||||
![]() Quote:
Isn't it just a matter of placing this on one of your category pages? Code:
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU |
|||||||||
|
|||
X-Cart forums © 2001-2020
|