| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Replacing "Featured Products" with "Recommend | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Quote:
could you post details of that hack, as I had tried one from this forum, but it doesn't show the price, just shows the list price!
__________________
4.0.16 [linux] http://www.petpassions.co.uk - pet products [live!] X-Cart Product Uploader Rough Demo Available http://www.dundeemedia.com/software/dmshopuploader.exe |
|||||||
#12
|
|||||||
|
|||||||
my version for 4.1.0rc4
create a file called random.php and put it in your stores root Code:
The query will only pick up live items that are in stock. Place: Code:
under Code:
in root/home.php create skin1/customer/main/randoms.tpl Code:
edit skin1/customer/home.tpl or wherever you want to place the random products and use this code to call it: Code:
|
|||||||
#13
|
|||||||
|
|||||||
damnit, the query will sometimes show a product twice Anyone know how to modify the query so that it will only select an item once?
|
|||||||
#14
|
|||||||
|
|||||||
Quote:
Try this. Code:
If you use multiple languages or have categories limited to certain members you should look at the queries in recommends.php to sort out modifying the query further for those cases. If you care about taxed prices and thumbnail images you also need to add just before the smarty assign: Code:
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#15
|
|||||||
|
|||||||
hey gecko, thanks for your help/input
Im getting this error: Parse error: parse error, unexpected T_VARIABLE in /home/metapot/public_html/tcart/random.php on line 3 This how my random.php currently looks like Code:
|
|||||||
#16
|
|||||||
|
|||||||
Sorry, I just posted the SQL part of the statement. You need to assign it to $query like this:
Code:
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#17
|
|||||||
|
|||||||
hey gecko, thanks for your help.
I used your code and now random.php is: Code:
but now the cart shows this error: INVALID SQL: 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT MIN(xcart_pricing.price) FROM xcart_pricing WHERE xcart_ SQL QUERY FAILURE:SELECT xcart_products.*, (SELECT MIN(xcart_pricing.price) FROM xcart_pricing WHERE xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.variantid = 0) AS price FROM xcart_products,xcart_pricing WHERE forsale='Y' AND avail>0 ORDER BY RAND() LIMIT 6 |
|||||||
#18
|
|||||||
|
|||||||
Quote:
What version of MySQL are you using? The subquery used requires MySQL 4.1. Also, I found an error in the query that creates duplicate rows. Here's the fixed query also rewritten to work with earlier versions of MYSQL: Code:
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#19
|
|||||||
|
|||||||
thanks gecko, worked like a charm!
|
|||||||
#20
|
|||||||
|
|||||||
Hi guys,
I was trying out his mod. Had no luck, then immediately reverted back to my backed up files. Now I've lost my featured products on my home page!!! Even though I've gone back to my original site with featured products on my home page. I'm having some trouble here trying to rectify this. Someone please help.
__________________
Version 4.1.9 |
|||||||
|
|||
X-Cart forums © 2001-2020
|