| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Random Image or Random Products - Category Specific | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
Anyone got a hack to this that will display a totally random product, no matter what page the user is on? Currently I've got this set up in a spot that shows on every page, and when it goes to non-product/category pages it shows up blank....
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#22
|
|||||||||
|
|||||||||
Isn't it just a matter of placing this on one of your category pages?
Code:
Simply modify the SQL to query the table, but not limiting to $cat .... then, ORDER BY RAND() and LIMIT 1 ...you should be set. LIMIT 3 if you use the random_products.tpl
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU |
|||||||||
#23
|
|||||||
|
|||||||
I see that thi smod display RANDOM IMG's and Products
I just want mine to display Random Featured Products Do i need to do all of this mod or is there a shorter way of doing it?? |
|||||||
#24
|
|||||||
|
|||||||
How to show products from only one category?
I've been able to get this to work great (thanks!) but was wondering if there was something I could modify so that it is:
1. Independent of the category page it is currently being displayed on and instead 2. Shows only random products from a category I specify, for example, I just want it to show products in "Category D" which has a categoryid of 8, no matter what page it's on. I assume I need to edit random.php and the SQL query, but I don't know how. Any help would be appreciated. Thank you
__________________
X-Cart Gold 4.3.1 Military Support Shop :: Army Wife Clothing, Military Support T-Shirts |
|||||||
#25
|
|||||||
|
|||||||
I figured it out!
Sorry, after a few more trials and errors, I figured it out!
In random.php, I simply changed Code:
to Code:
Where the number 8 above is the categoryid for the category who's products I want to display. Hope this helps someone!
__________________
X-Cart Gold 4.3.1 Military Support Shop :: Army Wife Clothing, Military Support T-Shirts |
|||||||
#26
|
|||||||
|
|||||||
Re: Random Image or Random Products - Category Specific
This mod is working great I was just wondering if someone could add some functionality I cannot figure out? I would like to have on the home page 4 different specified categorys with 3 random featured products a piece. I would like these to be displayed in a row instead of a column. Is any of this possible?
__________________
X-cart Version: 4.1.3 PHP Version: 5.1.6 MySQL: 3.23.58 OS: Linux |
|||||||
#27
|
|||||||
|
|||||||
Re: Random Image or Random Products - Category Specific
Great mod - nearly works
I'm now getting an SQL error when I click on my categories.. "INVALID SQL: 1176 : Key 'pam' doesn't exist in table 'xcart_categories' SQL QUERY FAILURE:SELECT categoryid FROM xcart_categories USE INDEX (pam) WHERE categoryid_path LIKE '12/%' AND avail='Y'" Apart from this - the mod is fantastic. Thanks, Ian
__________________
xcart v4.1.3 [unix] |
|||||||
#28
|
|||||||
|
|||||||
Re: Random Image or Random Products - Category Specific
---don't panic - i've fixed it by switching the INDEX from (pam) to (pa)
Great mod
__________________
xcart v4.1.3 [unix] |
|||||||
#29
|
|||||||
|
|||||||
Re: Random Image or Random Products - Category Specific
If anyone's still keeping an eye on this thread was there ever a solution for displaying the product price? Product name was solved but..
__________________
xcart v4.1.3 [unix] |
|||||||
#30
|
|||||||
|
|||||||
Re: Random Image or Random Products - Category Specific
well the mod sounds great but i'll pose one question before i run off and start implementing something that may not work as needed.
i'd ideally like to be able to display 3-4 random products in a row, with images, with links to the product page obviously, but i only want to do this on certain pages where the layout allows for this. mainly the main page, and some other page that don't contain much information other some text. i know you can call this from where ever you want, but i know there was mention of one random image, and that is was specific to certain categories. the pages i'd want this on have no category, or membership affliation. is this doable? thanks,
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|