Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display random product

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-14-2005, 10:50 AM
 
mpj mpj is offline
 

Senior Member
  
Join Date: Feb 2005
Posts: 106
 

Default Display random product

Is something like this possible?
__________________
X-Cart 4.0.11


{My simple mods}
Adding Market list and % save on product detail
Quantity input box
Reply With Quote
  #2  
Old 03-14-2005, 11:11 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Depends on where you want it to show. The Recommended products shown on the product page are completely random.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-14-2005, 12:58 PM
 
mpj mpj is offline
 

Senior Member
  
Join Date: Feb 2005
Posts: 106
 

Default

Actually I want to display it on the homepage

skin1>customer>home.tpl

I've tried to random loop produts loop=$products but it doesn't seem to be looping it.


here's what I have added

Code:
{*RANDOM FEATURE ITEM*} {capture name=menu} {section name=product loop=$products max=1} <A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}"> [img]{$xcart_web_dir}/thumb/phpthumb.php?src=/product/thumb/t_{$products[product].productid}.jpg&w=70&h=70[/img] </A> {/section} {/capture} { include file="menu.tpl" menu_title="Product of the day" menu_content=$smarty.capture.menu } {*RANDOM FEATURE ITEM*}
__________________
X-Cart 4.0.11


{My simple mods}
Adding Market list and % save on product detail
Quantity input box
Reply With Quote
  #4  
Old 06-06-2005, 03:48 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default Random products for entire site?

I need to randomize all products in all categories. I've looked at the recommends for help, but it just isn't the same relation to the overall products.php.

Has anyone done this? If so, do you have the SQL statement that will give the option in General Settings/Appearance to display randomn products?

Funky has some 3.x code in the forum, but there just doesn't seem to be anything for 4.0.x. In recommends you see $rnd = rand(); and ORDER BY RAND(NOW()+$rnd). Ideas?

Thanks, Mike
__________________
4.1.9
Reply With Quote
  #5  
Old 06-10-2005, 03:29 PM
 
Allan Martel Allan Martel is offline
 

Advanced Member
  
Join Date: Mar 2004
Posts: 72
 

Default

I have managed to replace the "Featured Products" with "Recommended Products" on home.php - now 6 products are displayed at random instead of the static "Featured Products"

My next goal would be to make this now display the pricing information and the "Buy Now" button, in 2 rows of 3 products....any help?

Heres what I did:

in skin1/customer/home.tpl, add
Code:
{include file="modules/Recommended_products/recommends.tpl"}
under

Code:
{include file="customer/home_main.tpl"}

In skin1/customer/main/welcome.tpl

remove

Code:
{include file="customer/main/featured.tpl" f_products=$f_products}

and finally, in home.php add:

Code:
if(!empty($active_modules["Recommended_Products"])) include "./recommends.php";

under
Code:
if (empty($products)) include "./featured_products.php";

This was done in 4.0.11

Hope this helps someone!

Allan
__________________
____________
____________

X-Cart v 4.0.14
X-Cart v 4.0.11
____________
____________
Reply With Quote
  #6  
Old 06-10-2005, 03:52 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

I think that is a good solution and may investigate, but there must be a way to just display all products at random?

Has anyone done this? The main reason we need this is that our providers are soiking their product names to get better display and it's very annoying.

TelaFirma, I know you know how to do this one...

Thanks, Mike
__________________
4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:03 AM.

   

 
X-Cart forums © 2001-2020