| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Random Products - 2 Products Per Row - In Place of Featured | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Random Products - 2 Products Per Row - In Place of Featured
I was wondering if anybody had ever replaced the featured products on the home page with a random list of 6-8 products, two per row? My thinking is it would make the site look less static. Anyone know how to achieve this?
__________________
- okdpm X-Cart Gold Version: 3.5.1 Things are more like they are now than they have ever been before... |
|||||||
#2
|
|||||||
|
|||||||
I don't have a solution, but you're right. Random products would be a great feature.
|
|||||||
#3
|
|||||||
|
|||||||
The code must be in there already as it uses it for the recommended products.
__________________
ex x-cart guru |
|||||||
#4
|
|||||||
|
|||||||
I'm not a programmer by any means, or I'd be happy to dig in and find it. I was just hoping somebody had already done this, or would find it an interesting challenge and share the code with all of us.
__________________
- okdpm X-Cart Gold Version: 3.5.1 Things are more like they are now than they have ever been before... |
|||||||
#5
|
|||||||||
|
|||||||||
Code:
Whew what a SQL query http://www.php.net/manual/en/printwn/function.rand.php Little mix of rand(); and some modified or added SQL queries and its possible.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#6
|
|||||||
|
|||||||
Boomer,
Wow! Now I see why I'm not a programmer. Is your code snippit what we need to accomplish this, and if so, where would we paste this in at??
__________________
- okdpm X-Cart Gold Version: 3.5.1 Things are more like they are now than they have ever been before... |
|||||||
#7
|
|||||||
|
|||||||
this is the current sql not the new stuff. the new stuff will be more complex than this.
need to add this into customer/home.php Code:
This will bring in a list of random products. Then we need to create this random.php in customer/ and is based on reccomends.php Code:
You will then need to include this in the home page by modifying the appropriate templates.
__________________
ex x-cart guru |
|||||||
#8
|
|||||||
|
|||||||
funkydunk,
Thanks a million for the code. I made the change to my customer/home.php and created the customer/random.php, but nothing changed. I still have the same 'Featured Products' showing up as they always have. I see where you said to 'include this in the home page by modifying the appropriate templates'. Would you please explain this in more detail (i.e. which templates and what exactly to add), as not only am I not a programmer, I am VERY new to X-Cart as well. Looking forward to hearing from you.
__________________
- okdpm X-Cart Gold Version: 3.5.1 Things are more like they are now than they have ever been before... |
|||||||
#9
|
|||||||
|
|||||||
PLEASE BACKUP ALL FILES BEFOREHAND JUST IN CASE!!
I haven't tested this but I would change skin1/customer/home_main.tpl as follows: from: {elseif $main eq "catalog" and $current_category.category eq ""} {include file="customer/main/welcome.tpl" f_products=$f_products} to: Code:
Then amend customer/main/welcome.tpl to: Code:
then creat a new template customer/main/randoms.tpl Code:
then creat a new lbl in the languages area named lbl_random_products with the value that y9ou want to have shown in the top of the box.
__________________
ex x-cart guru |
|||||||
#10
|
|||||||
|
|||||||
funkydunk,
Wow, you're good....you're FUNKY good! The only problem is that my random products have "Enter your price !" instead of "Our price: $". This kind of needs addressed as we don't want the customer thinking they can pick their own price. Any ideas on what the last tweak to the puzzle might be?
__________________
- okdpm X-Cart Gold Version: 3.5.1 Things are more like they are now than they have ever been before... |
|||||||
|
|||
X-Cart forums © 2001-2020
|